[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tip-98526ee7229be8537373aebe037b74cac112d84b@git.kernel.org>
Date: Thu, 14 Aug 2014 01:51:02 -0700
From: tip-bot for Adrian Hunter <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: acme@...hat.com, linux-kernel@...r.kernel.org, eranian@...gle.com,
paulus@...ba.org, hpa@...or.com, mingo@...nel.org,
peterz@...radead.org, namhyung@...il.com, jolsa@...hat.com,
fweisbec@...il.com, adrian.hunter@...el.com, dsahern@...il.com,
tglx@...utronix.de
Subject: [tip:perf/core] perf script:
Allow callchains if any event samples them
Commit-ID: 98526ee7229be8537373aebe037b74cac112d84b
Gitweb: http://git.kernel.org/tip/98526ee7229be8537373aebe037b74cac112d84b
Author: Adrian Hunter <adrian.hunter@...el.com>
AuthorDate: Thu, 31 Jul 2014 09:00:59 +0300
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Wed, 13 Aug 2014 19:21:53 -0300
perf script: Allow callchains if any event samples them
perf script was not displaying callchains if any selected event did not
have PERF_SAMPLE_CALLCHAIN.
Change this to disable callchains only if all selected events do not
have PERF_SAMPLE_CALLCHAIN.
Signed-off-by: Adrian Hunter <adrian.hunter@...el.com>
Cc: David Ahern <dsahern@...il.com>
Cc: Frederic Weisbecker <fweisbec@...il.com>
Cc: Jiri Olsa <jolsa@...hat.com>
Cc: Namhyung Kim <namhyung@...il.com>
Cc: Paul Mackerras <paulus@...ba.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Stephane Eranian <eranian@...gle.com>
Link: http://lkml.kernel.org/r/1406786474-9306-17-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/builtin-script.c | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 37d2b60..c1b7029 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -184,10 +184,6 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
if (perf_evsel__check_stype(evsel, PERF_SAMPLE_IP, "IP",
PERF_OUTPUT_IP))
return -EINVAL;
-
- if (!no_callchain &&
- !(attr->sample_type & PERF_SAMPLE_CALLCHAIN))
- symbol_conf.use_callchain = false;
}
if (PRINT_FIELD(ADDR) &&
@@ -290,6 +286,19 @@ static int perf_session__check_output_opt(struct perf_session *session)
set_print_ip_opts(&evsel->attr);
}
+ if (!no_callchain) {
+ bool use_callchain = false;
+
+ evlist__for_each(session->evlist, evsel) {
+ if (evsel->attr.sample_type & PERF_SAMPLE_CALLCHAIN) {
+ use_callchain = true;
+ break;
+ }
+ }
+ if (!use_callchain)
+ symbol_conf.use_callchain = false;
+ }
+
/*
* set default for tracepoints to print symbols only
* if callchains are present
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists