summaryrefslogtreecommitdiff
path: root/tests/memanalyze.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-10-24 12:59:58 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-10-24 12:59:58 +0000
commit2fe5f5ab4b185fa156ca92c8c3e23fea5fe50795 (patch)
treea07ef38cb0381b16f371413563d920263df6e1aa /tests/memanalyze.pl
parent656d4b4c20bfd938ff6f0ce6ee5a84a50d7d3e76 (diff)
downloadcurl-2fe5f5ab4b185fa156ca92c8c3e23fea5fe50795.tar.gz
supports -l now to display the actual line that was prevented by memlimit
Diffstat (limited to 'tests/memanalyze.pl')
-rwxr-xr-xtests/memanalyze.pl24
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/memanalyze.pl b/tests/memanalyze.pl
index 4c1f7630d..49a21aa06 100755
--- a/tests/memanalyze.pl
+++ b/tests/memanalyze.pl
@@ -9,6 +9,7 @@
my $mallocs=0;
my $reallocs=0;
my $strdups=0;
+my $showlimit;
while(1) {
if($ARGV[0] eq "-v") {
@@ -19,7 +20,14 @@ while(1) {
$trace=1;
shift @ARGV;
}
- last;
+ elsif($ARGV[0] eq "-l") {
+ # only show what alloc that caused a memlimit failure
+ $showlimit=1;
+ shift @ARGV;
+ }
+ else {
+ last;
+ }
}
my $maxmem;
@@ -38,6 +46,7 @@ my $file = $ARGV[0];
if(! -f $file) {
print "Usage: memanalyze.pl [options] <dump file>\n",
"Options:\n",
+ " -l memlimit failure displayed\n",
" -v Verbose\n",
" -t Trace\n";
exit;
@@ -45,6 +54,19 @@ if(! -f $file) {
open(FILE, "<$file");
+if($showlimit) {
+ while(<FILE>) {
+ if(/^LIMIT.*memlimit$/) {
+ print $_;
+ last;
+ }
+ }
+ close(FILE);
+ exit;
+}
+
+
+
while(<FILE>) {
chomp $_;
$line = $_;