Skip to content

Commit 9788e24

Browse files
captain5050Sasha Levin
authored andcommitted
perf test parse-metric: Ensure aggregate counts appear to have run
[ Upstream commit ff9aeb6 ] Commit bb5a920 ("perf stat: Ensure metrics are displayed even with failed events") with failed events") made it so that counters which weren't enabled in the kernel were handled as NaN in metrics. This caused the "Parse and process metrics" test to start failing as it wasn't putting a non-zero value in these variables. Add arbitrary values of 1 to fix the test. Fixes: bb5a920 ("perf stat: Ensure metrics are displayed even with failed events") Signed-off-by: Ian Rogers <[email protected]> Cc: Adrian Hunter <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Chun-Tse Shao <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: James Clark <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Yang Li <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 5fd4396 commit 9788e24

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

tools/perf/tests/parse-metric.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ static void load_runtime_stat(struct evlist *evlist, struct value *vals)
4141
count = find_value(evsel->name, vals);
4242
evsel->supported = true;
4343
evsel->stats->aggr->counts.val = count;
44+
evsel->stats->aggr->counts.ena = 1;
45+
evsel->stats->aggr->counts.run = 1;
4446
}
4547
}
4648

0 commit comments

Comments
 (0)