add new mpool debug output parsing

git-svn: trunk@5047
0.95
Török Edvin 16 years ago
parent 8b2b7201e1
commit 70fb604d98
  1. 5
      ChangeLog
  2. 17
      contrib/mpoolparse/mpoolparse.pl
  3. 23
      contrib/mpoolparse/process.pl

@ -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) Fri Apr 17 16:44:50 EEST 2009 (edwin)
------------------------------------- -------------------------------------
* libclamav/mpool.c: update mpool frag sizes. * libclamav/mpool.c: update mpool frag sizes.

@ -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…
Cancel
Save