diff options
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-trace.c | 19 |
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)); |
2241 | out: | 2252 | out: |
2242 | err = 0; | 2253 | err = 0; |
2243 | out_put: | 2254 | out_put: |