[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1463119263-5569-3-git-send-email-namhyung@kernel.org>
Date: Fri, 13 May 2016 15:01:03 +0900
From: Namhyung Kim <namhyung@...nel.org>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
Jiri Olsa <jolsa@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Andi Kleen <andi@...stfloor.org>
Subject: [PATCH 3/3] perf stat: Use cpu-clock event for cpu targets
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@...nel.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
Powered by blists - more mailing lists