Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix stackcollapse-perf for C++ userland profiling

This fixes handling of function names with '::' involved, which
show up in C++ if you pass the perf script output through
demangling prior to stackcollapse-perf.

Also disables the skipping of non-kernel code -- perf is equally
useful for profiling user applications.
  • Loading branch information...
commit d99115a8a42736b42ae763f67c6871b8f07c1042 1 parent 9e00484
@toddlipcon toddlipcon authored
Showing with 8 additions and 4 deletions.
  1. +8 −4 stackcollapse-perf.pl
View
12 stackcollapse-perf.pl
@@ -75,13 +75,17 @@ sub remember_stack {
# Note the details skipped below, and customize as desired
- next if m/:.*:/; # skip summary lines
+ if (m/:.*:\s$/) {
+ # skip summary lines
+ next;
+ }
- if (/^\s*\w+ (\w+) (\S+)/) {
+ if (/^\s*\w+\s*(.+) (\S+)/) {
my ($func, $mod) = ($1, $2);
- next if $func =~ /\(/; # skip process names
- next unless $mod =~ /kernel/; # skip non-kernel
+ next if $func =~ /^\(/; # skip process names
unshift @stack, $func;
+ } else {
+ warn "Unrecognized line: $_";
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.