Skip to content

Commit

Permalink
when using --inline, addr2line sometimes produces "??" or "" as a res…
Browse files Browse the repository at this point in the history
…ult; fall back to default output in such case
  • Loading branch information
jan-konczak-cs-put committed Mar 27, 2021
1 parent d45f620 commit 449e931
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions stackcollapse-perf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,14 @@ sub inline {
$rawfunc =~ s/\+0x[\da-f]+$//;

if ($show_inline == 1 && $mod !~ m/(perf-\d+.map|kernel\.|\[[^\]]+\])/) {
unshift @stack, inline($pc, $mod);
next;
my $inlineRes = inline($pc, $mod);
# - empty result this happens e.g., when $mod does not exist or is a path to a compressed kernel module
# if this happens, the user will see error message from addr2line written to stderr
# - if addr2line results in "??" , then it's much more sane to fall back than produce a '??' in graph
if($inlineRes ne "" and $inlineRes ne "??" and $inlineRes ne "??:??:0" ) {
unshift @stack, inline($pc, $mod);
next;
}
}

next if $rawfunc =~ /^\(/; # skip process names
Expand Down

0 comments on commit 449e931

Please sign in to comment.