mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-03-22 07:27:12 +08:00
perf thread-stack: Switch thread_stack__init() to use e_machine
The architecture type is used to set the retpoline state. Rather than use the arch string switch to using the ELF machine that's readily available within the thread. 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:
committed by
Arnaldo Carvalho de Melo
parent
f33e7aa42e
commit
4b870f62c5
@@ -157,10 +157,10 @@ static int thread_stack__init(struct thread_stack *ts, struct thread *thread,
|
||||
|
||||
if (thread__maps(thread) && maps__machine(thread__maps(thread))) {
|
||||
struct machine *machine = maps__machine(thread__maps(thread));
|
||||
const char *arch = perf_env__arch(machine->env);
|
||||
uint16_t e_machine = thread__e_machine(thread, machine, /*e_flags=*/NULL);
|
||||
|
||||
ts->kernel_start = machine__kernel_start(machine);
|
||||
if (!strcmp(arch, "x86"))
|
||||
if (e_machine == EM_X86_64 || e_machine == EM_386)
|
||||
ts->rstate = X86_RETPOLINE_POSSIBLE;
|
||||
} else {
|
||||
ts->kernel_start = 1ULL << 63;
|
||||
|
||||
Reference in New Issue
Block a user