aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2018-11-06 16:07:12 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2018-12-17 12:54:18 -0500
commit692d0e63324d2954a0c63a812a8588e97023a295 (patch)
tree8ef1288c447d72eb487de7ced7d7f99d041767c6 /tools/perf
parent225f99e0c811e23836c4911a2ff147e167dd1fe8 (diff)
perf script: Use fallbacks for branch stacks
Branch stacks do not necessarily have the same cpumode as the 'ip'. Use the fallback functions in those cases. This patch depends on patch "perf tools: Add fallback functions for cases where cpumode is insufficient". Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: David S. Miller <davem@davemloft.net> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Leo Yan <leo.yan@linaro.org> Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Cc: stable@vger.kernel.org # 4.19 Link: http://lkml.kernel.org/r/20181106210712.12098-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-script.c12
-rw-r--r--tools/perf/util/scripting-engines/trace-event-python.c16
2 files changed, 14 insertions, 14 deletions
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 04913136bac9..3ea98fe72f7f 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -724,8 +724,8 @@ static int perf_sample__fprintf_brstack(struct perf_sample *sample,
724 if (PRINT_FIELD(DSO)) { 724 if (PRINT_FIELD(DSO)) {
725 memset(&alf, 0, sizeof(alf)); 725 memset(&alf, 0, sizeof(alf));
726 memset(&alt, 0, sizeof(alt)); 726 memset(&alt, 0, sizeof(alt));
727 thread__find_map(thread, sample->cpumode, from, &alf); 727 thread__find_map_fb(thread, sample->cpumode, from, &alf);
728 thread__find_map(thread, sample->cpumode, to, &alt); 728 thread__find_map_fb(thread, sample->cpumode, to, &alt);
729 } 729 }
730 730
731 printed += fprintf(fp, " 0x%"PRIx64, from); 731 printed += fprintf(fp, " 0x%"PRIx64, from);
@@ -771,8 +771,8 @@ static int perf_sample__fprintf_brstacksym(struct perf_sample *sample,
771 from = br->entries[i].from; 771 from = br->entries[i].from;
772 to = br->entries[i].to; 772 to = br->entries[i].to;
773 773
774 thread__find_symbol(thread, sample->cpumode, from, &alf); 774 thread__find_symbol_fb(thread, sample->cpumode, from, &alf);
775 thread__find_symbol(thread, sample->cpumode, to, &alt); 775 thread__find_symbol_fb(thread, sample->cpumode, to, &alt);
776 776
777 printed += symbol__fprintf_symname_offs(alf.sym, &alf, fp); 777 printed += symbol__fprintf_symname_offs(alf.sym, &alf, fp);
778 if (PRINT_FIELD(DSO)) { 778 if (PRINT_FIELD(DSO)) {
@@ -816,11 +816,11 @@ static int perf_sample__fprintf_brstackoff(struct perf_sample *sample,
816 from = br->entries[i].from; 816 from = br->entries[i].from;
817 to = br->entries[i].to; 817 to = br->entries[i].to;
818 818
819 if (thread__find_map(thread, sample->cpumode, from, &alf) && 819 if (thread__find_map_fb(thread, sample->cpumode, from, &alf) &&
820 !alf.map->dso->adjust_symbols) 820 !alf.map->dso->adjust_symbols)
821 from = map__map_ip(alf.map, from); 821 from = map__map_ip(alf.map, from);
822 822
823 if (thread__find_map(thread, sample->cpumode, to, &alt) && 823 if (thread__find_map_fb(thread, sample->cpumode, to, &alt) &&
824 !alt.map->dso->adjust_symbols) 824 !alt.map->dso->adjust_symbols)
825 to = map__map_ip(alt.map, to); 825 to = map__map_ip(alt.map, to);
826 826
diff --git a/tools/perf/util/scripting-engines/trace-event-python.c b/tools/perf/util/scripting-engines/trace-event-python.c
index 69aa93d4ee99..0c4b050f6fc2 100644
--- a/tools/perf/util/scripting-engines/trace-event-python.c
+++ b/tools/perf/util/scripting-engines/trace-event-python.c
@@ -494,14 +494,14 @@ static PyObject *python_process_brstack(struct perf_sample *sample,
494 pydict_set_item_string_decref(pyelem, "cycles", 494 pydict_set_item_string_decref(pyelem, "cycles",
495 PyLong_FromUnsignedLongLong(br->entries[i].flags.cycles)); 495 PyLong_FromUnsignedLongLong(br->entries[i].flags.cycles));
496 496
497 thread__find_map(thread, sample->cpumode, 497 thread__find_map_fb(thread, sample->cpumode,
498 br->entries[i].from, &al); 498 br->entries[i].from, &al);
499 dsoname = get_dsoname(al.map); 499 dsoname = get_dsoname(al.map);
500 pydict_set_item_string_decref(pyelem, "from_dsoname", 500 pydict_set_item_string_decref(pyelem, "from_dsoname",
501 _PyUnicode_FromString(dsoname)); 501 _PyUnicode_FromString(dsoname));
502 502
503 thread__find_map(thread, sample->cpumode, 503 thread__find_map_fb(thread, sample->cpumode,
504 br->entries[i].to, &al); 504 br->entries[i].to, &al);
505 dsoname = get_dsoname(al.map); 505 dsoname = get_dsoname(al.map);
506 pydict_set_item_string_decref(pyelem, "to_dsoname", 506 pydict_set_item_string_decref(pyelem, "to_dsoname",
507 _PyUnicode_FromString(dsoname)); 507 _PyUnicode_FromString(dsoname));
@@ -576,14 +576,14 @@ static PyObject *python_process_brstacksym(struct perf_sample *sample,
576 if (!pyelem) 576 if (!pyelem)
577 Py_FatalError("couldn't create Python dictionary"); 577 Py_FatalError("couldn't create Python dictionary");
578 578
579 thread__find_symbol(thread, sample->cpumode, 579 thread__find_symbol_fb(thread, sample->cpumode,
580 br->entries[i].from, &al); 580 br->entries[i].from, &al);
581 get_symoff(al.sym, &al, true, bf, sizeof(bf)); 581 get_symoff(al.sym, &al, true, bf, sizeof(bf));
582 pydict_set_item_string_decref(pyelem, "from", 582 pydict_set_item_string_decref(pyelem, "from",
583 _PyUnicode_FromString(bf)); 583 _PyUnicode_FromString(bf));
584 584
585 thread__find_symbol(thread, sample->cpumode, 585 thread__find_symbol_fb(thread, sample->cpumode,
586 br->entries[i].to, &al); 586 br->entries[i].to, &al);
587 get_symoff(al.sym, &al, true, bf, sizeof(bf)); 587 get_symoff(al.sym, &al, true, bf, sizeof(bf));
588 pydict_set_item_string_decref(pyelem, "to", 588 pydict_set_item_string_decref(pyelem, "to",
589 _PyUnicode_FromString(bf)); 589 _PyUnicode_FromString(bf));