aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-04-20 18:55:48 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-04-25 11:49:17 -0400
commit7ad356159542e1f0dd4703ff3604f67390657f57 (patch)
tree72a23c524ec4e60eb4a1f67e90ba3280ae4e90c5 /tools
parente557b674a9470dae99916be6105e6780b3a072ca (diff)
perf trace: Make --event honour --min-stack too
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-shj0fazntmskhjild5i6x73l@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/builtin-trace.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index d1bbcb9abca3..fc276d718172 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2126,6 +2126,17 @@ static int trace__event_handler(struct trace *trace, struct perf_evsel *evsel,
2126 union perf_event *event __maybe_unused, 2126 union perf_event *event __maybe_unused,
2127 struct perf_sample *sample) 2127 struct perf_sample *sample)
2128{ 2128{
2129 int callchain_ret = 0;
2130
2131 if (sample->callchain) {
2132 callchain_ret = trace__resolve_callchain(trace, evsel, sample, &callchain_cursor);
2133 if (callchain_ret == 0) {
2134 if (callchain_cursor.nr < trace->min_stack)
2135 goto out;
2136 callchain_ret = 1;
2137 }
2138 }
2139
2129 trace__printf_interrupted_entry(trace, sample); 2140 trace__printf_interrupted_entry(trace, sample);
2130 trace__fprintf_tstamp(trace, sample->time, trace->output); 2141 trace__fprintf_tstamp(trace, sample->time, trace->output);
2131 2142
@@ -2144,11 +2155,11 @@ static int trace__event_handler(struct trace *trace, struct perf_evsel *evsel,
2144 2155
2145 fprintf(trace->output, ")\n"); 2156 fprintf(trace->output, ")\n");
2146 2157
2147 if (sample->callchain) { 2158 if (callchain_ret > 0)
2148 if (trace__resolve_callchain(trace, evsel, sample, &callchain_cursor) == 0) 2159 trace__fprintf_callchain(trace, sample);
2149 trace__fprintf_callchain(trace, sample); 2160 else if (callchain_ret < 0)
2150 } 2161 pr_err("Problem processing %s callchain, skipping...\n", perf_evsel__name(evsel));
2151 2162out:
2152 return 0; 2163 return 0;
2153} 2164}
2154 2165