History

perf script: Move script_fetch_insn to trace-event-scripting.c

Add native_arch as a parameter to script_fetch_insn rather than relying on the builtin-script value that won't be initialized for the dlfilter and python Context use cases. Assume both of those cases are running natively.

Ian Rogers committed 1 year ago

Commit 1ff2ca31 parent 04051b46 files · +19 −23Browse files

Showing the changes to tools/perf/scripts/python (1 of 6 files). Show all

Unified · Split

tools/perf/scripts/python/Perf-Trace-Util/Context.c+1−1
@@ -93,7 +93,7 @@ static PyObject *perf_sample_insn(PyObject *obj, PyObject *args) · 92 unmodified lines
9393 if (c->sample->ip && !c->sample->insn_len && thread__maps(c->al->thread)) {
9494 struct machine *machine = maps__machine(thread__maps(c->al->thread));
9595
96− script_fetch_insn(c->sample, c->al->thread, machine);
96+ script_fetch_insn(c->sample, c->al->thread, machine, /*native_arch=*/true);
9797 }
9898 if (!c->sample->insn_len)
9999 Py_RETURN_NONE; /* N.B. This is a return statement */