perf callchain: Fix srcline printing with inlines
[ Upstream commit abec464767b5d26f0612250d511c18f420826ca1 ]
sample__fprintf_callchain() was using map__fprintf_srcline() which won't
report inline line numbers.
Fix by using the srcline from the callchain and falling back to the map
variant.
Fixes: 25da4fab5f ("perf evsel: Move fprintf methods to separate source file")
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Ian Rogers <irogers@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephen Brennan <stephen.s.brennan@oracle.com>
Cc: Tony Jones <tonyj@suse.de>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
27c53054d5
commit
68a9c15032
|
|
@ -182,8 +182,12 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
|
|||
if (print_dso && (!sym || !sym->inlined))
|
||||
printed += map__fprintf_dsoname_dsoff(map, print_dsoff, addr, fp);
|
||||
|
||||
if (print_srcline)
|
||||
printed += map__fprintf_srcline(map, addr, "\n ", fp);
|
||||
if (print_srcline) {
|
||||
if (node->srcline)
|
||||
printed += fprintf(fp, "\n %s", node->srcline);
|
||||
else
|
||||
printed += map__fprintf_srcline(map, addr, "\n ", fp);
|
||||
}
|
||||
|
||||
if (sym && sym->inlined)
|
||||
printed += fprintf(fp, " (inlined)");
|
||||
|
|
|
|||
Loading…
Reference in New Issue