Skip to content

Commit

Permalink
collapse perf: Allow whitespace in thread names
Browse files Browse the repository at this point in the history
This adds support to process perf script output for programs
containing threads with whitespace in the name.  For example:

"java main 25607 4794564.109216: cycles:"
  • Loading branch information
vgeorgiev authored and brendangregg committed Oct 11, 2015
1 parent b26eda5 commit dd1607c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stackcollapse-perf.pl
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ sub inline {
}

# event record start
if (/^(\S+)\s+(\d+)\s/) {
if (/^((\S+\s*)+)\s+(\d+)\s/) {
# default "perf script" output has TID but not PID
# eg, "java 25607 4794564.109216: cycles:"
if ($include_tid) {
Expand All @@ -180,7 +180,7 @@ sub inline {
} else {
$pname = $1;
}
} elsif (/^(\S+)\s+(\d+)\/(\d+)/) {
} elsif (/^((\S+\s*)+)\s+(\d+)\/(\d+)/) {
# eg, "java 24636/25607 [000] 4794564.109216: cycles:"
if ($include_tid) {
$pname = "$1-$2/$3";
Expand Down

0 comments on commit dd1607c

Please sign in to comment.