From d75cd553c03b9a81eaf38defea6d24883d1988c4 Mon Sep 17 00:00:00 2001 From: "dbaron%fas.harvard.edu" Date: Fri, 16 Nov 2001 02:47:07 +0000 Subject: [PATCH] Ignore the library/address part of the stack unless asked to use it. git-svn-id: svn://10.0.0.236/trunk@108252 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/tools/trace-malloc/diffbloatdump.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/mozilla/tools/trace-malloc/diffbloatdump.pl b/mozilla/tools/trace-malloc/diffbloatdump.pl index 982856b9b1f..29e08c49986 100755 --- a/mozilla/tools/trace-malloc/diffbloatdump.pl +++ b/mozilla/tools/trace-malloc/diffbloatdump.pl @@ -52,17 +52,23 @@ $::opt_help = 0; $::opt_depth = 6; $::opt_include_zero = 0; $::opt_allocation_count = 0; +$::opt_use_address = 0; Getopt::Long::Configure("pass_through"); -Getopt::Long::GetOptions("help", "depth=i", "include-zero", "allocation-count"); +Getopt::Long::GetOptions("help", "allocation-count", "depth=i", + "include-zero", "use-address"); if ($::opt_help) { die "usage: diffbloatdump.pl [options] --help Display this message - --depth= Only display frames at top of allocation stack. - --include-zero Display subtrees totalling zero. + --allocation-count Use allocation count rather than size (i.e., treat all sizes as 1). + --depth= Only display frames at top of allocation stack. + --include-zero Display subtrees totalling zero. + --use-address Don't ignore the address part of the stack trace + (can make comparison more accurate when comparing + results from the same build) "; } @@ -86,6 +92,10 @@ sub add_file($$) { # read the stack do { chomp($line); + if ( ! $::opt_use_address && + $line =~ /(.*)\[(.*)\]/) { + $line = $1; + } $stack[$#stack+1] = $line; } while ( ($line = <$infile>) && $line ne "\n" );