summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Bangoria <ravi.bangoria@linux.ibm.com>2018-11-15 15:25:32 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-03-05 16:42:21 +0100
commit2255c29ed609d3a6343184ecb00ddb34a6ab3836 (patch)
treeb4e1ba431de12db82bd17b0da987ece50ce9c257
parentd71744b5c149ebc78b7b70bf45298db838c15ff4 (diff)
downloadlinux-stable-2255c29ed609d3a6343184ecb00ddb34a6ab3836.tar.gz
linux-stable-2255c29ed609d3a6343184ecb00ddb34a6ab3836.tar.bz2
linux-stable-2255c29ed609d3a6343184ecb00ddb34a6ab3836.zip
perf stat: Use perf_evsel__is_clocki() for clock events
commit eb08d006054e7e374592068919e32579988602d4 upstream. 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 <ravi.bangoria@linux.ibm.com> Acked-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Anton Blanchard <anton@samba.org> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Thomas Richter <tmricht@linux.vnet.ibm.com> Cc: yuzhoujian@didichuxing.com Link: http://lkml.kernel.org/r/20181115095533.16930-1-ravi.bangoria@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: Tommi Rantala <tommi.t.rantala@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--tools/perf/util/stat-shadow.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index bbb0e042d8e5..9916d7eafeb8 100644
--- a/tools/perf/util/stat-shadow.c
+++ b/tools/perf/util/stat-shadow.c
@@ -212,8 +212,7 @@ void perf_stat__update_shadow_stats(struct perf_evsel *counter, u64 count,
count *= counter->scale;
- if (perf_evsel__match(counter, SOFTWARE, SW_TASK_CLOCK) ||
- perf_evsel__match(counter, SOFTWARE, SW_CPU_CLOCK))
+ if (perf_evsel__is_clock(counter))
update_runtime_stat(st, STAT_NSECS, 0, cpu, count);
else if (perf_evsel__match(counter, HARDWARE, HW_CPU_CYCLES))
update_runtime_stat(st, STAT_CYCLES, ctx, cpu, count);