public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] perf stat: Use perf_evsel__is_clocki() for clock events
@ 2018-11-15  9:55 Ravi Bangoria
  2018-11-15  9:55 ` [RFC 2/2] perf stat: Fix shadow stats " Ravi Bangoria
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ravi Bangoria @ 2018-11-15  9:55 UTC (permalink / raw)
  To: acme, jolsa
  Cc: alexander.shishkin, namhyung, yao.jin, linux-kernel, yuzhoujian,
	tmricht, anton, Ravi Bangoria

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>
---
 tools/perf/util/stat-shadow.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tools/perf/util/stat-shadow.c b/tools/perf/util/stat-shadow.c
index 8ad32763cfff..f0a8cec55c47 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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-12-18 13:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-15  9:55 [PATCH 1/2] perf stat: Use perf_evsel__is_clocki() for clock events Ravi Bangoria
2018-11-15  9:55 ` [RFC 2/2] perf stat: Fix shadow stats " Ravi Bangoria
2018-11-15 14:17   ` Jiri Olsa
2018-11-16  4:28     ` [PATCH] " Ravi Bangoria
2018-11-16 13:35       ` Jiri Olsa
2018-11-26 18:45         ` Arnaldo Carvalho de Melo
2018-11-27  8:20         ` Ravi Bangoria
2018-11-27 12:37           ` Arnaldo Carvalho de Melo
2018-12-14 20:19       ` [tip:perf/core] " tip-bot for Ravi Bangoria
2018-12-18 13:46       ` tip-bot for Ravi Bangoria
2018-11-15 13:55 ` [PATCH 1/2] perf stat: Use perf_evsel__is_clocki() " Jiri Olsa
2018-11-15 19:22   ` Arnaldo Carvalho de Melo
2018-11-22  7:13 ` [tip:perf/core] " tip-bot for Ravi Bangoria

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox