From ae6de318e5a58cc648d29ab5ed6d42d6167636c0 Mon Sep 17 00:00:00 2001 From: Pavel Tikhomirov Date: Fri, 6 Apr 2018 10:31:25 +0300 Subject: [PATCH] Revert "stats: save uptime to know when dump had happened" Leave dump_uptime in stats file for backward and forward compatibility though it is unused now. This reverts commit fbba4d249a49e34e41c7c63ed77fab1bee3a13de. Signed-off-by: Pavel Tikhomirov Signed-off-by: Andrei Vagin --- criu/cr-dump.c | 4 ---- criu/include/stats.h | 2 -- criu/proc_parse.c | 2 +- criu/stats.c | 22 ---------------------- 4 files changed, 1 insertion(+), 29 deletions(-) diff --git a/criu/cr-dump.c b/criu/cr-dump.c index 9e8425504..0f4f438b3 100644 --- a/criu/cr-dump.c +++ b/criu/cr-dump.c @@ -1571,8 +1571,6 @@ static int cr_pre_dump_finish(int ret) */ if (arch_set_thread_regs(root_item, false) < 0) goto err; - if (timing_uptime(TIME_DUMP_UPTIME)) - goto err; pstree_switch_state(root_item, TASK_ALIVE); timing_stop(TIME_FROZEN); @@ -1800,8 +1798,6 @@ static int cr_dump_finish(int ret) if (arch_set_thread_regs(root_item, true) < 0) return -1; - if (timing_uptime(TIME_DUMP_UPTIME)) - return -1; pstree_switch_state(root_item, (ret || post_dump_ret) ? TASK_ALIVE : opts.final_state); diff --git a/criu/include/stats.h b/criu/include/stats.h index 81775c856..07690b8ea 100644 --- a/criu/include/stats.h +++ b/criu/include/stats.h @@ -7,7 +7,6 @@ enum { TIME_MEMDUMP, TIME_MEMWRITE, TIME_IRMAP_RESOLVE, - TIME_DUMP_UPTIME, DUMP_TIME_NR_STATS, }; @@ -21,7 +20,6 @@ enum { extern void timing_start(int t); extern void timing_stop(int t); -extern int timing_uptime(int t); enum { CNT_PAGES_SCANNED, diff --git a/criu/proc_parse.c b/criu/proc_parse.c index 160a6fc58..bbabe2e89 100644 --- a/criu/proc_parse.c +++ b/criu/proc_parse.c @@ -2713,7 +2713,7 @@ err: return -1; } -int parse_uptime(struct timeval *_tv) +__maybe_unused int parse_uptime(struct timeval *_tv) { unsigned long sec, csec; FILE *f; diff --git a/criu/stats.c b/criu/stats.c index 2944474cd..64679b134 100644 --- a/criu/stats.c +++ b/criu/stats.c @@ -9,8 +9,6 @@ #include "stats.h" #include "util.h" #include "image.h" -#include "pid.h" -#include "proc_parse.h" #include "images/stats.pb-c.h" struct timing { @@ -97,14 +95,6 @@ void timing_stop(int t) timeval_accumulate(&tm->start, &now, &tm->total); } -int timing_uptime(int t) -{ - struct timing *tm; - - tm = get_timing(t); - return parse_uptime(&tm->total); -} - static void encode_time(int t, u_int32_t *to) { struct timing *tm; @@ -113,14 +103,6 @@ static void encode_time(int t, u_int32_t *to) *to = tm->total.tv_sec * USEC_PER_SEC + tm->total.tv_usec; } -static void encode_time_64(int t, u_int64_t *to) -{ - struct timing *tm; - - tm = get_timing(t); - *to = tm->total.tv_sec * USEC_PER_SEC + tm->total.tv_usec; -} - static void display_stats(int what, StatsEntry *stats) { if (what == DUMP_STATS) { @@ -131,8 +113,6 @@ static void display_stats(int what, StatsEntry *stats) pr_msg("Memory write time: %d us\n", stats->dump->memwrite_time); if (stats->dump->has_irmap_resolve) pr_msg("IRMAP resolve time: %d us\n", stats->dump->irmap_resolve); - if (stats->dump->has_dump_uptime) - pr_msg("Memory dump time-stamp: %" PRIu64 " us\n", stats->dump->dump_uptime); pr_msg("Memory pages scanned: %" PRIu64 " (0x%" PRIx64 ")\n", stats->dump->pages_scanned, stats->dump->pages_scanned); pr_msg("Memory pages skipped from parent: %" PRIu64 " (0x%" PRIx64 ")\n", @@ -175,8 +155,6 @@ void write_stats(int what) encode_time(TIME_MEMWRITE, &ds_entry.memwrite_time); ds_entry.has_irmap_resolve = true; encode_time(TIME_IRMAP_RESOLVE, &ds_entry.irmap_resolve); - ds_entry.has_dump_uptime = true; - encode_time_64(TIME_DUMP_UPTIME, &ds_entry.dump_uptime); ds_entry.pages_scanned = dstats->counts[CNT_PAGES_SCANNED]; ds_entry.pages_skipped_parent = dstats->counts[CNT_PAGES_SKIPPED_PARENT];