Skip to content
/ linux Public

Commit a1030ea

Browse files
captain5050Sasha Levin
authored andcommitted
perf callchain: Fix srcline printing with inlines
[ Upstream commit abec464 ] 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: 25da4fa ("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>
1 parent a1213ef commit a1030ea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/perf/util/evsel_fprintf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,12 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
177177
printed += fprintf(fp, ")");
178178
}
179179

180-
if (print_srcline)
181-
printed += map__fprintf_srcline(map, addr, "\n ", fp);
180+
if (print_srcline) {
181+
if (node->srcline)
182+
printed += fprintf(fp, "\n %s", node->srcline);
183+
else
184+
printed += map__fprintf_srcline(map, addr, "\n ", fp);
185+
}
182186

183187
if (sym && sym->inlined)
184188
printed += fprintf(fp, " (inlined)");

0 commit comments

Comments
 (0)