Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752501AbbHTJ4b (ORCPT ); Thu, 20 Aug 2015 05:56:31 -0400 Received: from terminus.zytor.com ([198.137.202.10]:35075 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751907AbbHTJ4T (ORCPT ); Thu, 20 Aug 2015 05:56:19 -0400 Date: Thu, 20 Aug 2015 02:55:43 -0700 From: tip-bot for Jiri Olsa Message-ID: Cc: dsahern@gmail.com, mail@milianw.de, acme@redhat.com, mingo@kernel.org, jolsa@redhat.com, milian.wolff@kdab.com, hpa@zytor.com, linux-kernel@vger.kernel.org, jolsa@kernel.org, namhyung@kernel.org, tglx@linutronix.de, a.p.zijlstra@chello.nl Reply-To: mingo@kernel.org, acme@redhat.com, jolsa@redhat.com, dsahern@gmail.com, mail@milianw.de, namhyung@kernel.org, tglx@linutronix.de, jolsa@kernel.org, linux-kernel@vger.kernel.org, a.p.zijlstra@chello.nl, milian.wolff@kdab.com, hpa@zytor.com In-Reply-To: <20150813071724.GA21322@krava.brq.redhat.com> References: <20150813071724.GA21322@krava.brq.redhat.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf script: Initialize callchain_param.record_mode Git-Commit-ID: 7322d6c98dd214252bd697f8dde64a3576977fab 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 Content-Length: 2625 Lines: 69 Commit-ID: 7322d6c98dd214252bd697f8dde64a3576977fab Gitweb: http://git.kernel.org/tip/7322d6c98dd214252bd697f8dde64a3576977fab Author: Jiri Olsa AuthorDate: Thu, 13 Aug 2015 09:17:24 +0200 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 17 Aug 2015 10:48:39 -0300 perf script: Initialize callchain_param.record_mode Milian Wolff reported non functional DWARF unwind under perf script. The reason is that perf script does not properly configure callchain_param.record_mode, which is needed by unwind code. Stealing the code from report and leaving the place for more initialization code in a hope we could merge it with report__setup_sample_type one day. Reported-by: Milian Wolff Signed-off-by: Jiri Olsa Tested-by: Milian Wolff Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20150813071724.GA21322@krava.brq.redhat.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-script.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 7b376d2..105332e 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -1561,6 +1561,22 @@ static int have_cmd(int argc, const char **argv) return 0; } +static void script__setup_sample_type(struct perf_script *script) +{ + struct perf_session *session = script->session; + u64 sample_type = perf_evlist__combined_sample_type(session->evlist); + + if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) { + if ((sample_type & PERF_SAMPLE_REGS_USER) && + (sample_type & PERF_SAMPLE_STACK_USER)) + callchain_param.record_mode = CALLCHAIN_DWARF; + else if (sample_type & PERF_SAMPLE_BRANCH_STACK) + callchain_param.record_mode = CALLCHAIN_LBR; + else + callchain_param.record_mode = CALLCHAIN_FP; + } +} + int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) { bool show_full_info = false; @@ -1849,6 +1865,7 @@ int cmd_script(int argc, const char **argv, const char *prefix __maybe_unused) goto out_delete; script.session = session; + script__setup_sample_type(&script); session->itrace_synth_opts = &itrace_synth_opts; -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/