Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759686AbcDMH1A (ORCPT ); Wed, 13 Apr 2016 03:27:00 -0400 Received: from terminus.zytor.com ([198.137.202.10]:51150 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758902AbcDMH06 (ORCPT ); Wed, 13 Apr 2016 03:26:58 -0400 Date: Wed, 13 Apr 2016 00:26:39 -0700 From: tip-bot for Arnaldo Carvalho de Melo Message-ID: Cc: dsahern@gmail.com, jolsa@kernel.org, tglx@linutronix.de, milian.wolff@kdab.com, mingo@kernel.org, wangnan0@huawei.com, adrian.hunter@intel.com, linux-kernel@vger.kernel.org, acme@redhat.com, namhyung@kernel.org, hpa@zytor.com Reply-To: milian.wolff@kdab.com, jolsa@kernel.org, tglx@linutronix.de, dsahern@gmail.com, adrian.hunter@intel.com, mingo@kernel.org, wangnan0@huawei.com, namhyung@kernel.org, hpa@zytor.com, acme@redhat.com, linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf trace: Make "--call-graph" affect just "raw_syscalls:sys_exit" Git-Commit-ID: fde54b7860ffff1c93e6b9abb3fbc3b8b95f2695 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: fde54b7860ffff1c93e6b9abb3fbc3b8b95f2695 Gitweb: http://git.kernel.org/tip/fde54b7860ffff1c93e6b9abb3fbc3b8b95f2695 Author: Arnaldo Carvalho de Melo AuthorDate: Mon, 11 Apr 2016 18:42:37 -0300 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 11 Apr 2016 22:18:23 -0300 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 Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: http://lkml.kernel.org/n/tip-fja1ods5vqpg42mdz09xcz3r@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-trace.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 08fb100..60ab7ce 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) goto out_delete_evlist; } - perf_evlist__config(evlist, &trace->opts, &callchain_param); + perf_evlist__config(evlist, &trace->opts, NULL); + + if (trace->opts.callgraph_set && trace->syscalls.events.sys_exit) { + perf_evsel__config_callchain(trace->syscalls.events.sys_exit, + &trace->opts, &callchain_param); + /* + * Now we have evsels with different sample_ids, use + * PERF_SAMPLE_IDENTIFIER to map from sample to evsel + * from a fixed position in each ring buffer record. + * + * As of this the changeset introducing this comment, this + * isn't strictly needed, as the fields that can come before + * PERF_SAMPLE_ID are all used, but we'll probably disable + * some of those for things like copying the payload of + * pointer syscall arguments, and for vfs_getname we don't + * need PERF_SAMPLE_ADDR and PERF_SAMPLE_IP, so do this + * here as a warning we need to use PERF_SAMPLE_IDENTIFIER. + */ + perf_evlist__set_sample_bit(evlist, IDENTIFIER); + perf_evlist__reset_sample_bit(evlist, ID); + } signal(SIGCHLD, sig_handler); signal(SIGINT, sig_handler);