Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf script: Factor out script_fetch_insn()

Factor out script_fetch_insn() so it can be reused.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: https://lore.kernel.org/r/20210530192308.7382-7-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

authored by

Adrian Hunter and committed by
Arnaldo Carvalho de Melo
d9ae9c97 cf9bfa6c

+11 -2
+8 -2
tools/perf/builtin-script.c
··· 1417 1417 { 1418 1418 } 1419 1419 1420 + void script_fetch_insn(struct perf_sample *sample, struct thread *thread, 1421 + struct machine *machine) 1422 + { 1423 + if (sample->insn_len == 0 && native_arch) 1424 + arch_fetch_insn(sample, thread, machine); 1425 + } 1426 + 1420 1427 static int perf_sample__fprintf_insn(struct perf_sample *sample, 1421 1428 struct perf_event_attr *attr, 1422 1429 struct thread *thread, ··· 1431 1424 { 1432 1425 int printed = 0; 1433 1426 1434 - if (sample->insn_len == 0 && native_arch) 1435 - arch_fetch_insn(sample, thread, machine); 1427 + script_fetch_insn(sample, thread, machine); 1436 1428 1437 1429 if (PRINT_FIELD(INSNLEN)) 1438 1430 printed += fprintf(fp, " ilen: %d", sample->insn_len);
+3
tools/perf/util/trace-event.h
··· 97 97 98 98 int script_spec_register(const char *spec, struct scripting_ops *ops); 99 99 100 + void script_fetch_insn(struct perf_sample *sample, struct thread *thread, 101 + struct machine *machine); 102 + 100 103 void setup_perl_scripting(void); 101 104 void setup_python_scripting(void); 102 105