diff options
author | Hector Chu <hectorchu@gmail.com> | 2011-09-07 13:53:29 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2011-09-07 13:53:29 -0400 |
commit | 7b2f214b6c3867699a37d405cf986d4f599d3f73 (patch) | |
tree | 0ceb1e0b297af770113041868de5f5d8c1d01617 | |
parent | ec3dc34d1287b5771c79fbe8794e409c8ef58e63 (diff) | |
download | go-7b2f214b6c3867699a37d405cf986d4f599d3f73.tar.gz go-7b2f214b6c3867699a37d405cf986d4f599d3f73.zip |
gopprof: regexp fixes
Extract Windows filenames correctly.
Don't remove receivers from method names.
Fixes #2227.
R=rsc
CC=golang-dev
https://golang.org/cl/4969059
-rwxr-xr-x | src/cmd/prof/gopprof | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/prof/gopprof b/src/cmd/prof/gopprof index be5f84e9e4..83438b7cd6 100755 --- a/src/cmd/prof/gopprof +++ b/src/cmd/prof/gopprof @@ -1241,7 +1241,7 @@ sub Disassemble { while (<OBJDUMP>) { s/\r//g; # turn windows-looking lines into unix-looking lines chop; - if (m|\s*([^:\s]+):(\d+)\s*$|) { + if (m|\s*(.+):(\d+)\s*$|) { # Location line of the form: # <filename>:<linenumber> $filename = $1; @@ -4485,7 +4485,7 @@ sub MapSymbolsWithNM { sub ShortFunctionName { my $function = shift; - while ($function =~ s/\([^()]*\)(\s*const)?//g) { } # Argument types + while ($function =~ s/(?<!\.)\([^()]*\)(\s*const)?//g) { } # Argument types while ($function =~ s/<[^<>]*>//g) { } # Remove template arguments $function =~ s/^.*\s+(\w+::)/$1/; # Remove leading type return $function; @@ -4494,7 +4494,7 @@ sub ShortFunctionName { # Trim overly long symbols found in disassembler output sub CleanDisassembly { my $d = shift; - while ($d =~ s/\([^()%]*\)(\s*const)?//g) { } # Argument types, not (%rax) + while ($d =~ s/(?<!\.)\([^()%]*\)(\s*const)?//g) { } # Argument types, not (%rax) while ($d =~ s/(\w+)<[^<>]*>/$1/g) { } # Remove template arguments return $d; } |