diff options
author | jiakai <jia.kai66@gmail.com> | 2014-07-28 11:28:03 -0700 |
---|---|---|
committer | Aliaksey Kandratsenka <alk@tut.by> | 2014-08-01 22:14:16 -0700 |
commit | f1ae3c446f34f6e8ac901caba281051ec269e4df (patch) | |
tree | 7e114e1d6fdc58678129b528017d164fbed09136 | |
parent | a12890df2519d254d1c497b8e0a65bb8fc9e1ab2 (diff) | |
download | gperftools-f1ae3c446f34f6e8ac901caba281051ec269e4df.tar.gz |
Add an option to allow disabling stripping template argument in pprof
-rwxr-xr-x | src/pprof | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -184,6 +184,7 @@ Options: --seconds=<n> Length of time for dynamic profiles [default=30 secs] --add_lib=<file> Read additional symbols and line info from the given library --lib_prefix=<dir> Comma separated list of library path prefixes + --no_strip_temp Do not strip template arguments from function names Reporting Granularity: --addresses Report at address level @@ -358,6 +359,9 @@ sub Init() { $main::opt_debug = 0; $main::opt_test = 0; + # Do not strip template argument in function names + $main::opt_no_strip_temp = 0; + # These are undocumented flags used only by unittests. $main::opt_test_stride = 0; @@ -420,6 +424,7 @@ sub Init() { "contentions!" => \$main::opt_contentions, "mean_delay!" => \$main::opt_mean_delay, "tools=s" => \$main::opt_tools, + "no_strip_temp!" => \$main::opt_no_strip_temp, "test!" => \$main::opt_test, "debug!" => \$main::opt_debug, # Undocumented flags used only by unittests: @@ -4850,7 +4855,10 @@ sub MapSymbolsWithNM { sub ShortFunctionName { my $function = shift; while ($function =~ s/\([^()]*\)(\s*const)?//g) { } # Argument types - while ($function =~ s/<[^<>]*>//g) { } # Remove template arguments + $function =~ s/<[0-9a-f]*>$//g; # Remove Address + if (!$main::opt_no_strip_temp) { + while ($function =~ s/<[^<>]*>//g) { } # Remove template arguments + } $function =~ s/^.*\s+(\w+::)/$1/; # Remove leading type return $function; } |