* [tip:perf/core] perf trace: Make --pf honour --min-stack too
@ 2016-04-27 15:30 tip-bot for Arnaldo Carvalho de Melo
0 siblings, 0 replies; only message in thread
From: tip-bot for Arnaldo Carvalho de Melo @ 2016-04-27 15:30 UTC (permalink / raw)
To: linux-tip-commits
Cc: wangnan0, acme, milian.wolff, jolsa, tglx, mingo, adrian.hunter,
hpa, namhyung, linux-kernel, dsahern
Commit-ID: 1df54290463e84b7b5eb26e5e6472167c3749901
Gitweb: http://git.kernel.org/tip/1df54290463e84b7b5eb26e5e6472167c3749901
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Wed, 20 Apr 2016 20:06:02 -0300
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 25 Apr 2016 12:49:17 -0300
perf trace: Make --pf honour --min-stack too
To check deeply nested page fault callchains.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Milian Wolff <milian.wolff@kdab.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-wuji34xx003kr88nmqt6jkgf@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 19 +++++++++++++++----
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index fc276d7..a4b133f 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2190,8 +2190,19 @@ static int trace__pgfault(struct trace *trace,
char map_type = 'd';
struct thread_trace *ttrace;
int err = -1;
+ int callchain_ret = 0;
thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
+
+ if (sample->callchain) {
+ callchain_ret = trace__resolve_callchain(trace, evsel, sample, &callchain_cursor);
+ if (callchain_ret == 0) {
+ if (callchain_cursor.nr < trace->min_stack)
+ goto out_put;
+ callchain_ret = 1;
+ }
+ }
+
ttrace = thread__trace(thread, trace->output);
if (ttrace == NULL)
goto out_put;
@@ -2234,10 +2245,10 @@ static int trace__pgfault(struct trace *trace,
fprintf(trace->output, " (%c%c)\n", map_type, al.level);
- if (sample->callchain) {
- if (trace__resolve_callchain(trace, evsel, sample, &callchain_cursor) == 0)
- trace__fprintf_callchain(trace, sample);
- }
+ if (callchain_ret > 0)
+ trace__fprintf_callchain(trace, sample);
+ else if (callchain_ret < 0)
+ pr_err("Problem processing %s callchain, skipping...\n", perf_evsel__name(evsel));
out:
err = 0;
out_put:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-04-27 15:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-27 15:30 [tip:perf/core] perf trace: Make --pf honour --min-stack too tip-bot for Arnaldo Carvalho de Melo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®