Skip to content

Commit c818cc0

Browse files
olsajiriacmel
authored andcommitted
perf stat: Fix --interval_clear option
Currently we display extra header line, like: # perf stat -I 1000 -a --interval-clear # time counts unit events insn per cycle branch-misses of all branches 2.964917103 3855.349912 cpu-clock (msec) # 3.855 CPUs utilized 2.964917103 23,993 context-switches # 0.006 M/sec 2.964917103 1,301 cpu-migrations # 0.329 K/sec ... Fixing the condition and getting proper: # perf stat -I 1000 -a --interval-clear # time counts unit events 2.359048938 1432.492228 cpu-clock (msec) # 1.432 CPUs utilized 2.359048938 7,613 context-switches # 0.002 M/sec 2.359048938 419 cpu-migrations # 0.133 K/sec ... Signed-off-by: Jiri Olsa <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: David Ahern <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Fixes: 9660e08 ("perf stat: Add --interval-clear option") Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent a09603f commit c818cc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/perf/builtin-stat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1742,7 +1742,7 @@ static void print_interval(char *prefix, struct timespec *ts)
17421742
}
17431743
}
17441744

1745-
if ((num_print_interval == 0 && metric_only) || interval_clear)
1745+
if ((num_print_interval == 0 || interval_clear) && metric_only)
17461746
print_metric_headers(" ", true);
17471747
if (++num_print_interval == 25)
17481748
num_print_interval = 0;

0 commit comments

Comments
 (0)