summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiakai <jia.kai66@gmail.com>2014-07-28 11:28:03 -0700
committerAliaksey Kandratsenka <alk@tut.by>2014-08-01 22:14:16 -0700
commitf1ae3c446f34f6e8ac901caba281051ec269e4df (patch)
tree7e114e1d6fdc58678129b528017d164fbed09136
parenta12890df2519d254d1c497b8e0a65bb8fc9e1ab2 (diff)
downloadgperftools-f1ae3c446f34f6e8ac901caba281051ec269e4df.tar.gz
Add an option to allow disabling stripping template argument in pprof
-rwxr-xr-xsrc/pprof10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/pprof b/src/pprof
index d42677c..4f04094 100755
--- a/src/pprof
+++ b/src/pprof
@@ -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;
}