Skip to content

Commit

Permalink
only drop "L" (Java signature) for "java" processes
Browse files Browse the repository at this point in the history
  • Loading branch information
brendangregg committed Dec 5, 2014
1 parent df6c5c3 commit 6468e8b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions stackcollapse-perf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -72,25 +72,26 @@ sub remember_stack {
chomp;

if (m/^$/) {
if (defined $pname) { unshift @stack, $pname; }
if ($include_pname) { unshift @stack, $pname; }
remember_stack(join(";", @stack), 1) if @stack;
undef @stack;
undef $pname;
next;
}

if (/^(\S+)\s/) {
$include_pname and $pname = $1; # else skip this line
$pname = $1;
} elsif (/^\s*\w+\s*(.+) (\S+)/) {
my ($func, $mod) = ($1, $2);
next if $func =~ /^\(/; # skip process names
if ($tidy_java) {
if ($tidy_java and $pname eq "java") {
# eg, convert the following:
# Lorg/mozilla/javascript/ContextFactory;.call(Lorg/mozilla/javascript/ContextAction;)Ljava/lang/Object;
# Lorg/mozilla/javascript/ContextFactory;.call(Lorg/mozilla/javascript/C
# Lorg/mozilla/javascript/MemberBox;.<init>(Ljava/lang/reflect/Method;)V
# into:
# org/mozilla/javascript/ContextFactory:.call
# org/mozilla/javascript/ContextFactory:.call
# org/mozilla/javascript/MemberBox:.init
$func =~ s/;/:/g;
$func =~ tr/<>//d;
Expand Down

0 comments on commit 6468e8b

Please sign in to comment.