From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933881AbbI2Ipu (ORCPT ); Tue, 29 Sep 2015 04:45:50 -0400 Received: from terminus.zytor.com ([198.137.202.10]:37844 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933049AbbI2IpZ (ORCPT ); Tue, 29 Sep 2015 04:45:25 -0400 Date: Tue, 29 Sep 2015 01:45:13 -0700 From: tip-bot for Adrian Hunter Message-ID: Cc: mingo@kernel.org, acme@redhat.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, adrian.hunter@intel.com, jolsa@redhat.com, hpa@zytor.com Reply-To: linux-kernel@vger.kernel.org, tglx@linutronix.de, mingo@kernel.org, acme@redhat.com, hpa@zytor.com, jolsa@redhat.com, adrian.hunter@intel.com In-Reply-To: <1443186956-18718-13-git-send-email-adrian.hunter@intel.com> References: <1443186956-18718-13-git-send-email-adrian.hunter@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf inject: Set branch stack feature flag when synthesizing branch stacks Git-Commit-ID: 051a01b9a2c1c1ef3049973a43d9ed4ddcc946f3 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: 051a01b9a2c1c1ef3049973a43d9ed4ddcc946f3 Gitweb: http://git.kernel.org/tip/051a01b9a2c1c1ef3049973a43d9ed4ddcc946f3 Author: Adrian Hunter AuthorDate: Fri, 25 Sep 2015 16:15:43 +0300 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 28 Sep 2015 16:57:59 -0300 perf inject: Set branch stack feature flag when synthesizing branch stacks The branch stack feature flag is set by 'perf record' when recording data that contains branch stacks. Consequently, when 'perf inject' synthesizes branch stacks, the feature flag should be set also. Signed-off-by: Adrian Hunter Cc: Jiri Olsa Link: http://lkml.kernel.org/r/1443186956-18718-13-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-inject.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c index f62c49b..8638fad 100644 --- a/tools/perf/builtin-inject.c +++ b/tools/perf/builtin-inject.c @@ -537,9 +537,13 @@ static int __cmd_inject(struct perf_inject *inject) * The AUX areas have been removed and replaced with * synthesized hardware events, so clear the feature flag. */ - if (inject->itrace_synth_opts.set) + if (inject->itrace_synth_opts.set) { perf_header__clear_feat(&session->header, HEADER_AUXTRACE); + if (inject->itrace_synth_opts.last_branch) + perf_header__set_feat(&session->header, + HEADER_BRANCH_STACK); + } session->header.data_offset = output_data_offset; session->header.data_size = inject->bytes_written; perf_session__write_header(session, session->evlist, fd, true);