Skip to content

Commit eb08d00

Browse files
Ravi Bangoriaacmel
authored andcommitted
perf stat: Use perf_evsel__is_clocki() for clock events
We already have function to check if a given event is either SW_CPU_CLOCK or SW_TASK_CLOCK. Utilize it. Signed-off-by: Ravi Bangoria <[email protected]> Acked-by: Jiri Olsa <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Anton Blanchard <[email protected]> Cc: Jin Yao <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Thomas Richter <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 11a64a0 commit eb08d00

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

tools/perf/util/stat-shadow.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,7 @@ void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 count,
212212

213213
count *= counter->scale;
214214

215-
if (perf_evsel__match(counter, SOFTWARE, SW_TASK_CLOCK) ||
216-
perf_evsel__match(counter, SOFTWARE, SW_CPU_CLOCK))
215+
if (perf_evsel__is_clock(counter))
217216
update_runtime_stat(st, STAT_NSECS, 0, cpu, count);
218217
else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES))
219218
update_runtime_stat(st, STAT_CYCLES, ctx, cpu, count);

0 commit comments

Comments
 (0)