提交 692d0e63 编写于 作者: A Adrian Hunter 提交者: Arnaldo Carvalho de Melo

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: NAdrian 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.comSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 225f99e0
...@@ -724,8 +724,8 @@ static int perf_sample__fprintf_brstack(struct perf_sample *sample, ...@@ -724,8 +724,8 @@ static int perf_sample__fprintf_brstack(struct perf_sample *sample,
if (PRINT_FIELD(DSO)) { if (PRINT_FIELD(DSO)) {
memset(&alf, 0, sizeof(alf)); memset(&alf, 0, sizeof(alf));
memset(&alt, 0, sizeof(alt)); memset(&alt, 0, sizeof(alt));
thread__find_map(thread, sample->cpumode, from, &alf); thread__find_map_fb(thread, sample->cpumode, from, &alf);
thread__find_map(thread, sample->cpumode, to, &alt); thread__find_map_fb(thread, sample->cpumode, to, &alt);
} }
printed += fprintf(fp, " 0x%"PRIx64, from); printed += fprintf(fp, " 0x%"PRIx64, from);
...@@ -771,8 +771,8 @@ static int perf_sample__fprintf_brstacksym(struct perf_sample *sample, ...@@ -771,8 +771,8 @@ static int perf_sample__fprintf_brstacksym(struct perf_sample *sample,
from = br->entries[i].from; from = br->entries[i].from;
to = br->entries[i].to; to = br->entries[i].to;
thread__find_symbol(thread, sample->cpumode, from, &alf); thread__find_symbol_fb(thread, sample->cpumode, from, &alf);
thread__find_symbol(thread, sample->cpumode, to, &alt); thread__find_symbol_fb(thread, sample->cpumode, to, &alt);
printed += symbol__fprintf_symname_offs(alf.sym, &alf, fp); printed += symbol__fprintf_symname_offs(alf.sym, &alf, fp);
if (PRINT_FIELD(DSO)) { if (PRINT_FIELD(DSO)) {
...@@ -816,11 +816,11 @@ static int perf_sample__fprintf_brstackoff(struct perf_sample *sample, ...@@ -816,11 +816,11 @@ static int perf_sample__fprintf_brstackoff(struct perf_sample *sample,
from = br->entries[i].from; from = br->entries[i].from;
to = br->entries[i].to; to = br->entries[i].to;
if (thread__find_map(thread, sample->cpumode, from, &alf) && if (thread__find_map_fb(thread, sample->cpumode, from, &alf) &&
!alf.map->dso->adjust_symbols) !alf.map->dso->adjust_symbols)
from = map__map_ip(alf.map, from); from = map__map_ip(alf.map, from);
if (thread__find_map(thread, sample->cpumode, to, &alt) && if (thread__find_map_fb(thread, sample->cpumode, to, &alt) &&
!alt.map->dso->adjust_symbols) !alt.map->dso->adjust_symbols)
to = map__map_ip(alt.map, to); to = map__map_ip(alt.map, to);
......
...@@ -494,14 +494,14 @@ static PyObject *python_process_brstack(struct perf_sample *sample, ...@@ -494,14 +494,14 @@ static PyObject *python_process_brstack(struct perf_sample *sample,
pydict_set_item_string_decref(pyelem, "cycles", pydict_set_item_string_decref(pyelem, "cycles",
PyLong_FromUnsignedLongLong(br->entries[i].flags.cycles)); PyLong_FromUnsignedLongLong(br->entries[i].flags.cycles));
thread__find_map(thread, sample->cpumode, thread__find_map_fb(thread, sample->cpumode,
br->entries[i].from, &al); br->entries[i].from, &al);
dsoname = get_dsoname(al.map); dsoname = get_dsoname(al.map);
pydict_set_item_string_decref(pyelem, "from_dsoname", pydict_set_item_string_decref(pyelem, "from_dsoname",
_PyUnicode_FromString(dsoname)); _PyUnicode_FromString(dsoname));
thread__find_map(thread, sample->cpumode, thread__find_map_fb(thread, sample->cpumode,
br->entries[i].to, &al); br->entries[i].to, &al);
dsoname = get_dsoname(al.map); dsoname = get_dsoname(al.map);
pydict_set_item_string_decref(pyelem, "to_dsoname", pydict_set_item_string_decref(pyelem, "to_dsoname",
_PyUnicode_FromString(dsoname)); _PyUnicode_FromString(dsoname));
...@@ -576,14 +576,14 @@ static PyObject *python_process_brstacksym(struct perf_sample *sample, ...@@ -576,14 +576,14 @@ static PyObject *python_process_brstacksym(struct perf_sample *sample,
if (!pyelem) if (!pyelem)
Py_FatalError("couldn't create Python dictionary"); Py_FatalError("couldn't create Python dictionary");
thread__find_symbol(thread, sample->cpumode, thread__find_symbol_fb(thread, sample->cpumode,
br->entries[i].from, &al); br->entries[i].from, &al);
get_symoff(al.sym, &al, true, bf, sizeof(bf)); get_symoff(al.sym, &al, true, bf, sizeof(bf));
pydict_set_item_string_decref(pyelem, "from", pydict_set_item_string_decref(pyelem, "from",
_PyUnicode_FromString(bf)); _PyUnicode_FromString(bf));
thread__find_symbol(thread, sample->cpumode, thread__find_symbol_fb(thread, sample->cpumode,
br->entries[i].to, &al); br->entries[i].to, &al);
get_symoff(al.sym, &al, true, bf, sizeof(bf)); get_symoff(al.sym, &al, true, bf, sizeof(bf));
pydict_set_item_string_decref(pyelem, "to", pydict_set_item_string_decref(pyelem, "to",
_PyUnicode_FromString(bf)); _PyUnicode_FromString(bf));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册