2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-29 13:28:27 +00:00

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 <ptikhomirov@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Pavel Tikhomirov 2018-04-06 10:31:25 +03:00 committed by Andrei Vagin
parent 7ca133f5b3
commit ae6de318e5
4 changed files with 1 additions and 29 deletions

View File

@ -1571,8 +1571,6 @@ static int cr_pre_dump_finish(int ret)
*/ */
if (arch_set_thread_regs(root_item, false) < 0) if (arch_set_thread_regs(root_item, false) < 0)
goto err; goto err;
if (timing_uptime(TIME_DUMP_UPTIME))
goto err;
pstree_switch_state(root_item, TASK_ALIVE); pstree_switch_state(root_item, TASK_ALIVE);
timing_stop(TIME_FROZEN); timing_stop(TIME_FROZEN);
@ -1800,8 +1798,6 @@ static int cr_dump_finish(int ret)
if (arch_set_thread_regs(root_item, true) < 0) if (arch_set_thread_regs(root_item, true) < 0)
return -1; return -1;
if (timing_uptime(TIME_DUMP_UPTIME))
return -1;
pstree_switch_state(root_item, pstree_switch_state(root_item,
(ret || post_dump_ret) ? (ret || post_dump_ret) ?
TASK_ALIVE : opts.final_state); TASK_ALIVE : opts.final_state);

View File

@ -7,7 +7,6 @@ enum {
TIME_MEMDUMP, TIME_MEMDUMP,
TIME_MEMWRITE, TIME_MEMWRITE,
TIME_IRMAP_RESOLVE, TIME_IRMAP_RESOLVE,
TIME_DUMP_UPTIME,
DUMP_TIME_NR_STATS, DUMP_TIME_NR_STATS,
}; };
@ -21,7 +20,6 @@ enum {
extern void timing_start(int t); extern void timing_start(int t);
extern void timing_stop(int t); extern void timing_stop(int t);
extern int timing_uptime(int t);
enum { enum {
CNT_PAGES_SCANNED, CNT_PAGES_SCANNED,

View File

@ -2713,7 +2713,7 @@ err:
return -1; return -1;
} }
int parse_uptime(struct timeval *_tv) __maybe_unused int parse_uptime(struct timeval *_tv)
{ {
unsigned long sec, csec; unsigned long sec, csec;
FILE *f; FILE *f;

View File

@ -9,8 +9,6 @@
#include "stats.h" #include "stats.h"
#include "util.h" #include "util.h"
#include "image.h" #include "image.h"
#include "pid.h"
#include "proc_parse.h"
#include "images/stats.pb-c.h" #include "images/stats.pb-c.h"
struct timing { struct timing {
@ -97,14 +95,6 @@ void timing_stop(int t)
timeval_accumulate(&tm->start, &now, &tm->total); 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) static void encode_time(int t, u_int32_t *to)
{ {
struct timing *tm; 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; *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) static void display_stats(int what, StatsEntry *stats)
{ {
if (what == DUMP_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); pr_msg("Memory write time: %d us\n", stats->dump->memwrite_time);
if (stats->dump->has_irmap_resolve) if (stats->dump->has_irmap_resolve)
pr_msg("IRMAP resolve time: %d us\n", stats->dump->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, pr_msg("Memory pages scanned: %" PRIu64 " (0x%" PRIx64 ")\n", stats->dump->pages_scanned,
stats->dump->pages_scanned); stats->dump->pages_scanned);
pr_msg("Memory pages skipped from parent: %" PRIu64 " (0x%" PRIx64 ")\n", 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); encode_time(TIME_MEMWRITE, &ds_entry.memwrite_time);
ds_entry.has_irmap_resolve = true; ds_entry.has_irmap_resolve = true;
encode_time(TIME_IRMAP_RESOLVE, &ds_entry.irmap_resolve); 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_scanned = dstats->counts[CNT_PAGES_SCANNED];
ds_entry.pages_skipped_parent = dstats->counts[CNT_PAGES_SKIPPED_PARENT]; ds_entry.pages_skipped_parent = dstats->counts[CNT_PAGES_SKIPPED_PARENT];