1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- sub read_stack_usage_file {
- my %su;
- my $f = shift;
- open(my $fh, '<', $f)
- or die "cannot open $f: $!";
- while (<$fh>) {
- chomp;
- my ($file, $func, $size, $type) = split;
-
-
-
-
-
-
-
-
-
-
-
- next if $func =~ m/^[0-9]+$/;
- $func =~ s/\..*$//;
-
- $file =~ s/:[0-9]+$//;
- $su{"${file}\t${func}"} = {size => $size, type => $type};
- }
- close($fh);
- return \%su;
- }
- @ARGV == 2
- or die "usage: $0 <old> <new>";
- my $old = read_stack_usage_file($ARGV[0]);
- my $new = read_stack_usage_file($ARGV[1]);
- my @common = sort grep {exists $new->{$_}} keys %$old;
- for (@common) {
- my $x = $old->{$_}{size};
- my $y = $new->{$_}{size};
- my $delta = $y - $x;
- if ($delta) {
- printf "%s\t%d\t%d\t%+d\n", $_, $x, $y, $delta;
- }
- }
|