#!/usr/bin/perl $argv = $ARGV[0]; open( bloatFile, $argv ) or die "Can't open $argv: $!\n"; while () { if (/name=/) { ($td,$name,$func,$a,$ntd) = split(/>/, $_); ($fname, $memSize) = split( / /, $func ); ($trash, $linkName) = split( /"/, $name ); $namesLinks{$fname} = $linkName; if ($namesSizes{$fname}) { $namesSizes{$fname} = $namesSizes{$fname} + $memSize; } else { $namesSizes{$fname} = $memSize; } } } $argv = $ARGV[1]; if ($argv) { open( bloatFile, $argv ) or die "Can't open $argv: $!\n"; while () { if (/name=/) { ($td,$name,$func,$a,$ntd) = split(/>/, $_); ($fname, $memSize) = split( / /, $func ); $namesSizes{$fname} = $namesSizes{$fname} - $memSize; } } } sub byvalue { $namesSizes{$b} <=> $namesSizes{$a} } print ''; print "\n\n"; print "Bloat Blame Delta\n"; print ''; print "\n\n\n\n"; print "\n"; foreach $key (sort byvalue keys %namesSizes) { if ($namesSizes{$key}) { print "\n"; print ' \n"; print " \n"; print "\n" } } print "
Memory AllocatedFunction NameLink
', $namesSizes{$key}," ", $key, "
\n";