aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-04-11 17:42:37 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-04-11 21:18:23 -0400
commitfde54b7860ffff1c93e6b9abb3fbc3b8b95f2695 (patch)
treebba9a05957c58881f1e7c19a7f73773d8299812f /tools/perf
parent01e0d50c3f95cb1bae2dbfd83173bc2864d6d28c (diff)
perf trace: Make "--call-graph" affect just "raw_syscalls:sys_exit"
We don't need the callchains at the syscall enter tracepoint, just when finishing it at syscall exit, so reduce the overhead by asking for callchains just at syscall exit. Suggested-by: Milian Wolff <milian.wolff@kdab.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-fja1ods5vqpg42mdz09xcz3r@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-trace.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 08fb100b91fa..60ab7ce3bc90 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -2749,7 +2749,27 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
2749 goto out_delete_evlist; 2749 goto out_delete_evlist;
2750 } 2750 }
2751 2751
2752 perf_evlist__config(evlist, &trace->opts, &callchain_param); 2752 perf_evlist__config(evlist, &trace->opts, NULL);
2753
2754 if (trace->opts.callgraph_set && trace->syscalls.events.sys_exit) {
2755 perf_evsel__config_callchain(trace->syscalls.events.sys_exit,
2756 &trace->opts, &callchain_param);
2757 /*
2758 * Now we have evsels with different sample_ids, use
2759 * PERF_SAMPLE_IDENTIFIER to map from sample to evsel
2760 * from a fixed position in each ring buffer record.
2761 *
2762 * As of this the changeset introducing this comment, this
2763 * isn't strictly needed, as the fields that can come before
2764 * PERF_SAMPLE_ID are all used, but we'll probably disable
2765 * some of those for things like copying the payload of
2766 * pointer syscall arguments, and for vfs_getname we don't
2767 * need PERF_SAMPLE_ADDR and PERF_SAMPLE_IP, so do this
2768 * here as a warning we need to use PERF_SAMPLE_IDENTIFIER.
2769 */
2770 perf_evlist__set_sample_bit(evlist, IDENTIFIER);
2771 perf_evlist__reset_sample_bit(evlist, ID);
2772 }
2753 2773
2754 signal(SIGCHLD, sig_handler); 2774 signal(SIGCHLD, sig_handler);
2755 signal(SIGINT, sig_handler); 2775 signal(SIGINT, sig_handler);