summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-inject.c
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2015-09-25 15:15:43 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-09-28 21:57:59 +0200
commit051a01b9a2c1c1ef3049973a43d9ed4ddcc946f3 (patch)
tree07ec77d470b1f000f816e9a7c97eedc3649803f8 /tools/perf/builtin-inject.c
parentperf report: Skip events with null branch stacks (diff)
downloadlinux-051a01b9a2c1c1ef3049973a43d9ed4ddcc946f3.tar.xz
linux-051a01b9a2c1c1ef3049973a43d9ed4ddcc946f3.zip
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 <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Link: http://lkml.kernel.org/r/1443186956-18718-13-git-send-email-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '')
-rw-r--r--tools/perf/builtin-inject.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/perf/builtin-inject.c b/tools/perf/builtin-inject.c
index f62c49b35be0..8638fad8a085 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);