Skip to content

Commit 487ae3b

Browse files
captain5050acmel
authored andcommitted
perf stat: Don't display zero tool counts
Andi reported (see link below) a regression when printing the 'duration_time' tool event, where it gets printed as "not counted" for most of the CPUs, fix it by skipping zero counts for tool events. Reported-by: Andi Kleen <[email protected]> Signed-off-by: Ian Rogers <[email protected]> Tested-by: Andi Kleen <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Athira Rajeev <[email protected]> Cc: Claire Jensen <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Kan Liang <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: https://lore.kernel.org/all/ZMlrzcVrVi1lTDmn@tassilo/ Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 8cdd4ae commit 487ae3b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tools/perf/util/stat-display.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,11 @@ static bool should_skip_zero_counter(struct perf_stat_config *config,
931931
*/
932932
if (config->aggr_mode == AGGR_THREAD && config->system_wide)
933933
return true;
934+
935+
/* Tool events have the software PMU but are only gathered on 1. */
936+
if (evsel__is_tool(counter))
937+
return true;
938+
934939
/*
935940
* Skip value 0 when it's an uncore event and the given aggr id
936941
* does not belong to the PMU cpumask.

0 commit comments

Comments
 (0)