Skip to content

Commit

Permalink
allow one whitespace in thread names, and replace it with underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
brendangregg committed Oct 11, 2015
1 parent 385950d commit d536c61
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions stackcollapse-perf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -170,25 +170,33 @@ sub inline {
}

# event record start
if (/^((\S+\s*)+)\s+(\d+)\s/) {
if (/^(\S+\s*?\S*?)\s+(\d+)\s/) {
# default "perf script" output has TID but not PID
# eg, "java 25607 4794564.109216: cycles:"
# eg, "java 12688 [002] 6544038.708352: cpu-clock:"
# eg, "V8 WorkerThread 25607 4794564.109216: cycles:"
# other combinations possible
if ($include_tid) {
$pname = "$1-?/$2";
} elsif ($include_pid) {
$pname = "$1-?";
} else {
$pname = $1;
}
} elsif (/^((\S+\s*)+)\s+(\d+)\/(\d+)/) {
$pname =~ tr/ /_/;
} elsif (/^(\S+\s*?\S*?)\s+(\d+)\/(\d+)/) {
# eg, "java 24636/25607 [000] 4794564.109216: cycles:"
# eg, "java 12688/12764 6544038.708352: cpu-clock:"
# eg, "V8 WorkerThread 24636/25607 [000] 94564.109216: cycles:"
# other combinations possible
if ($include_tid) {
$pname = "$1-$2/$3";
} elsif ($include_pid) {
$pname = "$1-$2";
} else {
$pname = $1;
}
$pname =~ tr/ /_/;

# stack line
} elsif (/^\s*(\w+)\s*(.+) \((\S*)\)/) {
Expand Down

0 comments on commit d536c61

Please sign in to comment.