Re: [PATCH] perf stat: Improve runtime stat for interval mode

From: Jin, Yao
Date: Mon Apr 20 2020 - 10:59:25 EST


Hi Jiri,

On 4/20/2020 5:19 PM, Jiri Olsa wrote:
On Fri, Apr 17, 2020 at 08:51:54AM +0800, Jin Yao wrote:

SNIP

diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index ec053dc1e35c..d5c326ff46d0 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -359,6 +359,7 @@ static void process_interval(void)
clock_gettime(CLOCK_MONOTONIC, &ts);
diff_timespec(&rs, &ts, &ref_time);
+ perf_stat__reset_rt_stat();

could you use just existing:

perf_stat__reset_shadow_per_stat(&rt_stat)

or perhaps event perf_stat__reset_shadow_stats, given
that we init walltime_nsecs_stats just few lines below

jirka


Yes, I can use the existing function to reset rt_stat, I don't need to define a new one.

Posted v2 yet.

Thanks
Jin Yao

read_counters(&rs);
if (STAT_RECORD) {

SNIP