Re: Wrong Perf Backtraces

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Each line is correct. I mean addresses match symbols. But some callers and callees do not match. Perhaps callchain misses some callers in between.

On 2020-03-29 05:13, ahmadkhorrami wrote:

Hi Mr. Olsa,
Thanks for your time. The problem is still there. Repeated lines are not limited to inline functions. If my script works on your system, it will show these lines.

On 2020-03-29 04:04, Jiri Olsa wrote:

On Sat, Mar 28, 2020 at 03:42:53AM +0430, ahmadkhorrami wrote:

Thanks. If you suggest the potentially bogus locations of the source code, I
will give a try.
the change below 'fixes' it for me:

$ perf script ...
evince 2220122 1605573.007639:      11759 cycles:u:
ffffffffaec012f0 [unknown] ([unknown])
7f93f17116b6 __mmap64+0x26 mmap64.c:59 (inlined)
7f93f17116b6 __mmap64+0x26 mmap64.c:47 (inlined)

it wasn't really broken, the output is just missing the source line
info in perf script callchain output, which adds the "missing part",
because for inlined entries the entry address stays the same for all
its inlined parts

could you try the change?


diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c
index 3b4842840db0..7349dfbbef2e 100644
--- a/tools/perf/util/evsel_fprintf.c
+++ b/tools/perf/util/evsel_fprintf.c
@@ -174,8 +174,11 @@ int sample__fprintf_callchain(struct perf_sample *sample, int left_alignment,
if (print_srcline)
printed += map__fprintf_srcline(map, addr, "\n  ", fp);

-            if (sym && sym->inlined)
+            if (sym && sym->inlined) {
+                if (node->srcline)
+                    printed += fprintf(fp, " %s", node->srcline);
printed += fprintf(fp, " (inlined)");
+            }

if (!print_oneline)
printed += fprintf(fp, "\n");

[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux