aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-04-20 19:06:02 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-04-25 11:49:17 -0400
commit1df54290463e84b7b5eb26e5e6472167c3749901 (patch)
treea992281f76373777b222f5f97216f85be2d2392a /tools
parent7ad356159542e1f0dd4703ff3604f67390657f57 (diff)
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>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-trace.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index fc276d718172..a4b133fac82b 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2190,8 +2190,19 @@ static int trace__pgfault(struct trace *trace,
2190 char map_type = 'd'; 2190 char map_type = 'd';
2191 struct thread_trace *ttrace; 2191 struct thread_trace *ttrace;
2192 int err = -1; 2192 int err = -1;
2193 int callchain_ret = 0;
2193 2194
2194 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid); 2195 thread = machine__findnew_thread(trace->host, sample->pid, sample->tid);
2196
2197 if (sample->callchain) {
2198 callchain_ret = trace__resolve_callchain(trace, evsel, sample, &callchain_cursor);
2199 if (callchain_ret == 0) {
2200 if (callchain_cursor.nr < trace->min_stack)
2201 goto out_put;
2202 callchain_ret = 1;
2203 }
2204 }
2205
2195 ttrace = thread__trace(thread, trace->output); 2206 ttrace = thread__trace(thread, trace->output);
2196 if (ttrace == NULL) 2207 if (ttrace == NULL)
2197 goto out_put; 2208 goto out_put;
@@ -2234,10 +2245,10 @@ static int trace__pgfault(struct trace *trace,
2234 2245
2235 fprintf(trace->output, " (%c%c)\n", map_type, al.level); 2246 fprintf(trace->output, " (%c%c)\n", map_type, al.level);
2236 2247
2237 if (sample->callchain) { 2248 if (callchain_ret > 0)
2238 if (trace__resolve_callchain(trace, evsel, sample, &callchain_cursor) == 0) 2249 trace__fprintf_callchain(trace, sample);
2239 trace__fprintf_callchain(trace, sample); 2250 else if (callchain_ret < 0)
2240 } 2251 pr_err("Problem processing %s callchain, skipping...\n", perf_evsel__name(evsel));
2241out: 2252out:
2242 err = 0; 2253 err = 0;
2243out_put: 2254out_put: