提交 6cd2cbfc 编写于 作者: A Adrian Hunter 提交者: Arnaldo Carvalho de Melo

perf evsel: Add support for synthesized branch stack sample type

Allow for a synthesized branch stack to be added to samples. As with
synthesized call chains, the sample type cannot be changed because it is
needed to continue to parse events. So add and use helper function
evsel__has_br_stack() to indicate a branch stack, whether original or
synthesized.
Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lore.kernel.org/lkml/20200429150751.12570-6-adrian.hunter@intel.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 ec90e42c
...@@ -417,6 +417,16 @@ static inline bool evsel__has_callchain(const struct evsel *evsel) ...@@ -417,6 +417,16 @@ static inline bool evsel__has_callchain(const struct evsel *evsel)
evsel->synth_sample_type & PERF_SAMPLE_CALLCHAIN; 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); struct perf_env *perf_evsel__env(struct evsel *evsel);
int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist); int perf_evsel__store_ids(struct evsel *evsel, struct evlist *evlist);
......
...@@ -1243,7 +1243,7 @@ static void dump_sample(struct evsel *evsel, union perf_event *event, ...@@ -1243,7 +1243,7 @@ static void dump_sample(struct evsel *evsel, union perf_event *event,
if (evsel__has_callchain(evsel)) if (evsel__has_callchain(evsel))
callchain__printf(evsel, sample); 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)); branch_stack__printf(sample, perf_evsel__has_branch_callstack(evsel));
if (sample_type & PERF_SAMPLE_REGS_USER) if (sample_type & PERF_SAMPLE_REGS_USER)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册