diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2021-05-25 12:51:05 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2021-05-25 10:07:17 -0300 |
commit | 3f8e009e01c4ed9f75c10f33936990f3a3d39fcd (patch) | |
tree | bf1c946587e5c2e87df60f916bb90a3901d1a23a /tools/perf/builtin-script.c | |
parent | 8271b5095811dd75843715a462a981fd5dfe704c (diff) | |
download | linux-stable-3f8e009e01c4ed9f75c10f33936990f3a3d39fcd.tar.gz linux-stable-3f8e009e01c4ed9f75c10f33936990f3a3d39fcd.tar.bz2 linux-stable-3f8e009e01c4ed9f75c10f33936990f3a3d39fcd.zip |
perf scripting python: Add 'addr_location' for 'addr'
If sample addr correlates to a symbol, add "addr_dso", "addr_symbol", and
"addr_symoff" to python scripting.
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/20210525095112.1399-4-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-script.c')
-rw-r--r-- | tools/perf/builtin-script.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index 2a062466c69f..f502d1c8a353 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c @@ -2189,10 +2189,19 @@ static int process_sample_event(struct perf_tool *tool, if (filter_cpu(sample)) goto out_put; - if (scripting_ops) - scripting_ops->process_event(event, sample, evsel, &al); - else + if (scripting_ops) { + struct addr_location *addr_al_ptr = NULL; + struct addr_location addr_al; + + if ((evsel->core.attr.sample_type & PERF_SAMPLE_ADDR) && + sample_addr_correlates_sym(&evsel->core.attr)) { + thread__resolve(al.thread, &addr_al, sample); + addr_al_ptr = &addr_al; + } + scripting_ops->process_event(event, sample, evsel, &al, addr_al_ptr); + } else { process_event(scr, sample, evsel, &al, machine); + } out_put: addr_location__put(&al); |