diff options
| author | Ian Rogers <irogers@google.com> | 2026-01-26 14:05:48 -0800 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-01-27 01:35:22 -0300 |
| commit | 7ce6dfc603ed01044ebe58472a584d9995281ca2 (patch) | |
| tree | 8222b98ed628a606bab37222482a42830a4f4c21 /tools/perf/scripts/python/Perf-Trace-Util | |
| parent | 0a6fb6604746c92bccc71867fd0bf3d3294335d1 (diff) | |
| download | linux-7ce6dfc603ed01044ebe58472a584d9995281ca2.tar.gz linux-7ce6dfc603ed01044ebe58472a584d9995281ca2.zip | |
perf script: Fix script_fetch_insn for more than just x86
The script_fetch_insn code was only supported on natively running x86.
Implement a crude elf_machine_max_instruction_length function and use to
give an instruction length on more than just x86.
Use the ELF machine to determine the length to use to support
cross-architecture development.
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>
[ Conditionally define EM_CSKY and EM_LOONGARCH for older distros ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/Perf-Trace-Util')
| -rw-r--r-- | tools/perf/scripts/python/Perf-Trace-Util/Context.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/scripts/python/Perf-Trace-Util/Context.c b/tools/perf/scripts/python/Perf-Trace-Util/Context.c index 60dcfe56d4d9..c19f44610983 100644 --- a/tools/perf/scripts/python/Perf-Trace-Util/Context.c +++ b/tools/perf/scripts/python/Perf-Trace-Util/Context.c @@ -93,7 +93,7 @@ static PyObject *perf_sample_insn(PyObject *obj, PyObject *args) if (c->sample->ip && !c->sample->insn_len && thread__maps(c->al->thread)) { struct machine *machine = maps__machine(thread__maps(c->al->thread)); - script_fetch_insn(c->sample, c->al->thread, machine, /*native_arch=*/true); + perf_sample__fetch_insn(c->sample, c->al->thread, machine); } if (!c->sample->insn_len) Py_RETURN_NONE; /* N.B. This is a return statement */ |
