mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 06:45:35 +00:00
stats: Rename existing timing and cnt counters into dump_... ones
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
@@ -8,7 +8,7 @@ enum {
|
|||||||
TIME_MEMDUMP,
|
TIME_MEMDUMP,
|
||||||
TIME_MEMWRITE,
|
TIME_MEMWRITE,
|
||||||
|
|
||||||
TIME_NR_STATS,
|
DUMP_TIME_NR_STATS,
|
||||||
};
|
};
|
||||||
|
|
||||||
void timing_start(int t);
|
void timing_start(int t);
|
||||||
@@ -19,7 +19,7 @@ enum {
|
|||||||
CNT_PAGES_SKIPPED_PARENT,
|
CNT_PAGES_SKIPPED_PARENT,
|
||||||
CNT_PAGES_WRITTEN,
|
CNT_PAGES_WRITTEN,
|
||||||
|
|
||||||
CNT_NR_STATS,
|
DUMP_CNT_NR_STATS,
|
||||||
};
|
};
|
||||||
|
|
||||||
void cnt_add(int c, unsigned long val);
|
void cnt_add(int c, unsigned long val);
|
||||||
|
8
stats.c
8
stats.c
@@ -11,15 +11,15 @@ struct timing {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct dump_stats {
|
struct dump_stats {
|
||||||
struct timing timings[TIME_NR_STATS];
|
struct timing timings[DUMP_TIME_NR_STATS];
|
||||||
unsigned long counts[CNT_NR_STATS];
|
unsigned long counts[DUMP_CNT_NR_STATS];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dump_stats *dstats;
|
struct dump_stats *dstats;
|
||||||
|
|
||||||
void cnt_add(int c, unsigned long val)
|
void cnt_add(int c, unsigned long val)
|
||||||
{
|
{
|
||||||
BUG_ON(c >= CNT_NR_STATS);
|
BUG_ON(c >= DUMP_CNT_NR_STATS);
|
||||||
dstats->counts[c] += val;
|
dstats->counts[c] += val;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +43,7 @@ static void timeval_accumulate(const struct timeval *from, const struct timeval
|
|||||||
|
|
||||||
void timing_start(int t)
|
void timing_start(int t)
|
||||||
{
|
{
|
||||||
BUG_ON(t >= TIME_NR_STATS);
|
BUG_ON(t >= DUMP_TIME_NR_STATS);
|
||||||
gettimeofday(&dstats->timings[t].start, NULL);
|
gettimeofday(&dstats->timings[t].start, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user