diff --git a/ChangeLog b/ChangeLog index 16fafed57..b1dd047c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Apr 17 16:47:44 EEST 2009 (edwin) +------------------------------------- + * contrib/mpoolparse/mpoolparse.pl, contrib/mpoolparse/process.pl: + add new mpool debug output parsing + Fri Apr 17 16:44:50 EEST 2009 (edwin) ------------------------------------- * libclamav/mpool.c: update mpool frag sizes. diff --git a/contrib/mpoolparse/mpoolparse.pl b/contrib/mpoolparse/mpoolparse.pl deleted file mode 100644 index 70b1ad892..000000000 --- a/contrib/mpoolparse/mpoolparse.pl +++ /dev/null @@ -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"; -} - diff --git a/contrib/mpoolparse/process.pl b/contrib/mpoolparse/process.pl new file mode 100644 index 000000000..f3a01b335 --- /dev/null +++ b/contrib/mpoolparse/process.pl @@ -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"; +}