From: tip-bot for Ravi Bangoria <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, jolsa@kernel.org,
alexander.shishkin@linux.intel.com, tglx@linutronix.de,
ravi.bangoria@linux.ibm.com, yao.jin@linux.intel.com,
hpa@zytor.com, tmricht@linux.vnet.ibm.com, anton@samba.org,
namhyung@kernel.org, mingo@kernel.org
Subject: [tip:perf/core] perf stat: Use perf_evsel__is_clocki() for clock events
Date: Wed, 21 Nov 2018 23:13:36 -0800 [thread overview]
Message-ID: <tip-eb08d006054e7e374592068919e32579988602d4@git.kernel.org> (raw)
In-Reply-To: <20181115095533.16930-1-ravi.bangoria@linux.ibm.com>
Commit-ID: eb08d006054e7e374592068919e32579988602d4
Gitweb: https://git.kernel.org/tip/eb08d006054e7e374592068919e32579988602d4
Author: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
AuthorDate: Thu, 15 Nov 2018 15:25:32 +0530
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 21 Nov 2018 22:39:57 -0300
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 <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>
---
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);
prev parent reply other threads:[~2018-11-22 7:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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-bot for Ravi Bangoria [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-eb08d006054e7e374592068919e32579988602d4@git.kernel.org \
--to=tipbot@zytor.com \
--cc=acme@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=anton@samba.org \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=ravi.bangoria@linux.ibm.com \
--cc=tglx@linutronix.de \
--cc=tmricht@linux.vnet.ibm.com \
--cc=yao.jin@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).