Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

perf callchain: Fix srcline printing with inlines

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: 25da4fab5f66e659 ("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>

authored by

Ian Rogers and committed by
Arnaldo Carvalho de Melo
abec4647 a2297e74

+6 -2
+6 -2
tools/perf/util/evsel_fprintf.c
··· 185 185 if (print_dso && (!sym || !sym->inlined)) 186 186 printed += map__fprintf_dsoname_dsoff(map, print_dsoff, addr, fp); 187 187 188 - if (print_srcline) 189 - printed += map__fprintf_srcline(map, addr, "\n ", fp); 188 + if (print_srcline) { 189 + if (node->srcline) 190 + printed += fprintf(fp, "\n %s", node->srcline); 191 + else 192 + printed += map__fprintf_srcline(map, addr, "\n ", fp); 193 + } 190 194 191 195 if (sym && sym->inlined) 192 196 printed += fprintf(fp, " (inlined)");