mirror of https://github.com/Cisco-Talos/clamav
parent
8b2b7201e1
commit
70fb604d98
@ -1,17 +0,0 @@ |
||||
#!/usr/bin/perl |
||||
|
||||
use strict; |
||||
use warnings; |
||||
|
||||
my %frags = (); |
||||
|
||||
while (<>) { |
||||
chomp; |
||||
next unless /^LibClamAV Warning: [mc]alloc .* size (\d+) .*$/; |
||||
$frags{$1}++; |
||||
} |
||||
|
||||
foreach (sort {$a<=>$b} (keys(%frags))) { |
||||
print "$_, /* ($frags{$_}) */\n"; |
||||
} |
||||
|
@ -0,0 +1,23 @@ |
||||
#!/usr/bin/perl |
||||
use strict; |
||||
use warnings; |
||||
|
||||
my %reallocs; |
||||
my %mallocs; |
||||
while (<>) { |
||||
if (/realloc @ 0x([0-9a-f]+)/) { |
||||
$reallocs{$1}=""; |
||||
} |
||||
if (/malloc 0x([0-9a-f]+) size ([0-9]+)/) { |
||||
$mallocs{$1}=$2; |
||||
} |
||||
} |
||||
my %sizes; |
||||
while (my ($address, $size) = each(%mallocs)) { |
||||
if (not defined $reallocs{$address}) { |
||||
$sizes{$size}++; |
||||
} |
||||
} |
||||
while (my ($size, $count) = each(%sizes)) { |
||||
print "$size, /* $count */\n"; |
||||
} |
Loading…
Reference in new issue