mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 22:36:17 +01:00
perf callchain: Switch callchain_param_setup from an arch to an e_machine
Increase use of e_machine by replacing callchain_param_setup's arch argument to be an e_machine typically read from the session. Signed-off-by: Ian Rogers <irogers@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: James Clark <james.clark@linaro.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Leo Yan <leo.yan@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Shimin Guo <shimin.guo@skydio.com> Cc: Yujie Liu <yujie.liu@intel.com> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
7ce6dfc603
commit
f33e7aa42e
5 changed files with 8 additions and 10 deletions
|
|
@ -448,7 +448,7 @@ static int report__setup_sample_type(struct report *rep)
|
|||
}
|
||||
}
|
||||
|
||||
callchain_param_setup(sample_type, perf_env__arch(perf_session__env(rep->session)));
|
||||
callchain_param_setup(sample_type, perf_session__e_machine(session));
|
||||
|
||||
if (rep->stitch_lbr && (callchain_param.record_mode != CALLCHAIN_LBR)) {
|
||||
ui__warning("Can't find LBR callchain. Switch off --stitch-lbr.\n"
|
||||
|
|
@ -1283,7 +1283,6 @@ static int process_attr(const struct perf_tool *tool __maybe_unused,
|
|||
struct evlist **pevlist)
|
||||
{
|
||||
struct perf_session *session;
|
||||
struct perf_env *env;
|
||||
u64 sample_type;
|
||||
int err;
|
||||
|
||||
|
|
@ -1297,8 +1296,7 @@ static int process_attr(const struct perf_tool *tool __maybe_unused,
|
|||
*/
|
||||
sample_type = evlist__combined_sample_type(*pevlist);
|
||||
session = (*pevlist)->session;
|
||||
env = perf_session__env(session);
|
||||
callchain_param_setup(sample_type, perf_env__arch(env));
|
||||
callchain_param_setup(sample_type, perf_session__e_machine(session));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2859,7 +2859,7 @@ static int process_attr(const struct perf_tool *tool, union perf_event *event,
|
|||
* on events sample_type.
|
||||
*/
|
||||
sample_type = evlist__combined_sample_type(evlist);
|
||||
callchain_param_setup(sample_type, perf_env__arch(perf_session__env(scr->session)));
|
||||
callchain_param_setup(sample_type, perf_session__e_machine(evsel__session(evsel)));
|
||||
|
||||
/* Enable fields for callchain entries */
|
||||
if (symbol_conf.use_callchain &&
|
||||
|
|
@ -3834,7 +3834,7 @@ static void script__setup_sample_type(struct perf_script *script)
|
|||
struct perf_session *session = script->session;
|
||||
u64 sample_type = evlist__combined_sample_type(session->evlist);
|
||||
|
||||
callchain_param_setup(sample_type, perf_env__arch(session->machines.host.env));
|
||||
callchain_param_setup(sample_type, perf_session__e_machine(session));
|
||||
|
||||
if (script->stitch_lbr && (callchain_param.record_mode != CALLCHAIN_LBR)) {
|
||||
pr_warning("Can't find LBR callchain. Switch off --stitch-lbr.\n"
|
||||
|
|
|
|||
|
|
@ -1681,7 +1681,7 @@ void callchain_cursor_reset(struct callchain_cursor *cursor)
|
|||
map_symbol__exit(&node->ms);
|
||||
}
|
||||
|
||||
void callchain_param_setup(u64 sample_type, const char *arch)
|
||||
void callchain_param_setup(u64 sample_type, uint16_t e_machine)
|
||||
{
|
||||
if (symbol_conf.use_callchain || symbol_conf.cumulate_callchain) {
|
||||
if ((sample_type & PERF_SAMPLE_REGS_USER) &&
|
||||
|
|
@ -1703,7 +1703,7 @@ void callchain_param_setup(u64 sample_type, const char *arch)
|
|||
* erroneous entries. Always skipping the LR and starting from the FP
|
||||
* can result in missing entries.
|
||||
*/
|
||||
if (callchain_param.record_mode == CALLCHAIN_FP && !strcmp(arch, "arm64"))
|
||||
if (callchain_param.record_mode == CALLCHAIN_FP && e_machine == EM_AARCH64)
|
||||
dwarf_callchain_users = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ int callchain_branch_counts(struct callchain_root *root,
|
|||
u64 *branch_count, u64 *predicted_count,
|
||||
u64 *abort_count, u64 *cycles_count);
|
||||
|
||||
void callchain_param_setup(u64 sample_type, const char *arch);
|
||||
void callchain_param_setup(u64 sample_type, uint16_t e_machine);
|
||||
|
||||
bool callchain_cnode_matched(struct callchain_node *base_cnode,
|
||||
struct callchain_node *pair_cnode);
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@ void perf_sample__fetch_insn(struct perf_sample *sample,
|
|||
if (!sample->ip || sample->insn_len != 0)
|
||||
return;
|
||||
|
||||
e_machine = thread__e_machine(thread, machine);
|
||||
e_machine = thread__e_machine(thread, machine, /*e_flags=*/NULL);
|
||||
len = elf_machine_max_instruction_length(e_machine);
|
||||
len = thread__memcpy(thread, machine, sample->insn,
|
||||
sample->ip, len,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue