diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/util/evsel.h | 10 | ||||
-rw-r--r-- | tools/perf/util/session.c | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index a463bc65b001..bf999e3c50c7 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h @@ -417,6 +417,16 @@ static inline bool evsel__has_callchain(const struct evsel *evsel) evsel->synth_sample_type & PERF_SAMPLE_CALLCHAIN; } +static inline bool evsel__has_br_stack(const struct evsel *evsel) +{ + /* + * For reporting purposes, an evsel sample can have a recorded branch + * stack or a branch stack synthesized from AUX area data. + */ + return evsel->core.attr.sample_type & PERF_SAMPLE_BRANCH_STACK || + evsel->synth_sample_type & PERF_SAMPLE_BRANCH_STACK; +} + struct perf_env *perf_evsel__env(struct evsel *evsel); int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist); diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 0b0bfe5bef17..2b5a08a92ce5 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -1243,7 +1243,7 @@ static void dump_sample(struct evsel *evsel, union perf_event *event, if (evsel__has_callchain(evsel)) callchain__printf(evsel, sample); - if (sample_type & PERF_SAMPLE_BRANCH_STACK) + if (evsel__has_br_stack(evsel)) branch_stack__printf(sample, perf_evsel__has_branch_callstack(evsel)); if (sample_type & PERF_SAMPLE_REGS_USER) |