OSDN Git Service

perf stat: Update walltime_nsecs_stats in interval mode
authorAndi Kleen <ak@linux.intel.com>
Thu, 31 Aug 2017 19:40:36 +0000 (12:40 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 13 Sep 2017 12:49:14 +0000 (09:49 -0300)
Some metrics (like GFLOPs) need walltime_nsecs_stats for each interval.
Compute it for each interval instead of only at the end.

Pointed out by Jiri.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/20170831194036.30146-12-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c

index 855890e..88f1d5f 100644 (file)
@@ -415,6 +415,8 @@ static void process_interval(void)
                        pr_err("failed to write stat round event\n");
        }
 
+       init_stats(&walltime_nsecs_stats);
+       update_stats(&walltime_nsecs_stats, stat_config.interval * 1000000);
        print_counters(&rs, 0, NULL);
 }