From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Jiri Olsa <jolsa@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
Andi Kleen <andi@firstfloor.org>
Subject: [PATCH 3/3] perf stat: Use cpu-clock event for cpu targets
Date: Fri, 13 May 2016 15:01:03 +0900 [thread overview]
Message-ID: <1463119263-5569-3-git-send-email-namhyung@kernel.org> (raw)
In-Reply-To: <1463119263-5569-1-git-send-email-namhyung@kernel.org>
Currently perf stat always counts task-clock event by default. But it's
somewhat confusing for system-wide targets (especially with 'sleep N' as
the 'sleep' task just sleeps and doesn't use cputime). Changing to
cpu-clock event instead for that case makes more sense IMHO.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/builtin-stat.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 5645a8361de6..d602e9e93dc1 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1904,6 +1904,9 @@ static int add_default_attributes(void)
}
if (!evsel_list->nr_entries) {
+ if (target__has_cpu(&target))
+ default_attrs0[0].config = PERF_COUNT_SW_CPU_CLOCK;
+
if (perf_evlist__add_default_attrs(evsel_list, default_attrs0) < 0)
return -1;
if (pmu_have_event("cpu", "stalled-cycles-frontend")) {
--
2.8.2
next prev parent reply other threads:[~2016-05-13 6:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-13 6:01 [PATCH 1/3] perf diff: Fix indentation of stalled backend cycle Namhyung Kim
2016-05-13 6:01 ` [PATCH 2/3] perf stat: Update runtime using cpu-clock event Namhyung Kim
2016-05-20 6:43 ` [tip:perf/urgent] " tip-bot for Namhyung Kim
2016-05-13 6:01 ` Namhyung Kim [this message]
2016-05-20 6:44 ` [tip:perf/urgent] perf stat: Use cpu-clock event for cpu targets tip-bot for Namhyung Kim
2016-05-13 11:48 ` [PATCH 1/3] perf diff: Fix indentation of stalled backend cycle Arnaldo Carvalho de Melo
2016-05-13 13:42 ` Namhyung Kim
2016-05-13 17:57 ` Arnaldo Carvalho de Melo
2016-05-13 14:00 ` Andi Kleen
2016-05-20 6:43 ` [tip:perf/urgent] perf stat: " tip-bot for Namhyung Kim
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=1463119263-5569-3-git-send-email-namhyung@kernel.org \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=andi@firstfloor.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
/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).