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.
Showing the changes to tools/perf/scripts/python (1 of 11 files). Show all
Unified · Split
| @@ -93,7 +93,7 @@ static PyObject *perf_sample_insn(PyObject *obj, PyObject *args) · 92 unmodified lines | ||
| 93 | 93 | if (c->sample->ip && !c->sample->insn_len && thread__maps(c->al->thread)) { |
| 94 | 94 | struct machine *machine = maps__machine(thread__maps(c->al->thread)); |
| 95 | 95 | |
| 96 | − script_fetch_insn(c->sample, c->al->thread, machine, /*native_arch=*/true); | |
| 96 | + perf_sample__fetch_insn(c->sample, c->al->thread, machine); | |
| 97 | 97 | } |
| 98 | 98 | if (!c->sample->insn_len) |
| 99 | 99 | Py_RETURN_NONE; /* N.B. This is a return statement */ |