aboutsummaryrefslogtreecommitdiff
path: root/memanalyze.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2001-10-04 13:25:40 +0000
committerDaniel Stenberg <daniel@haxx.se>2001-10-04 13:25:40 +0000
commitcfb32ec0cdd617d2be0b7348cdc84a76bba85621 (patch)
treec784dd13ee7b4bc7aecf6faef6b1a5fddd1ee793 /memanalyze.pl
parent5d9ae88f58349022ee437fdf4dfc9e3a7f755beb (diff)
downloadgnurl-cfb32ec0cdd617d2be0b7348cdc84a76bba85621.tar.gz
gnurl-cfb32ec0cdd617d2be0b7348cdc84a76bba85621.tar.bz2
gnurl-cfb32ec0cdd617d2be0b7348cdc84a76bba85621.zip
supports the new ADDR prefix for getaddrinfo() and freeaddrinfo() tracing
Diffstat (limited to 'memanalyze.pl')
-rwxr-xr-xmemanalyze.pl40
1 files changed, 40 insertions, 0 deletions
diff --git a/memanalyze.pl b/memanalyze.pl
index a9dce2044..3006ffe70 100755
--- a/memanalyze.pl
+++ b/memanalyze.pl
@@ -168,6 +168,37 @@ while(<STDIN>) {
}
}
}
+ # ADDR url.c:1282 getaddrinfo() = 0x5ddd
+ elsif($_ =~ /^ADDR ([^:]*):(\d*) (.*)/) {
+ # generic match for the filename+linenumber
+ $source = $1;
+ $linenum = $2;
+ $function = $3;
+
+ if($function =~ /getaddrinfo\(\) = (\(nil\)|0x([0-9a-f]*))/) {
+ my $add = $2;
+ if($add eq "(nil)") {
+ ;
+ }
+ else {
+ $addrinfo{$add}=1;
+ $addrinfofile{$add}="$source:$linenum";
+ $addrinfos++;
+ }
+ }
+ # fclose(0x1026c8)
+ elsif($function =~ /freeaddrinfo\(0x([0-9a-f]*)\)/) {
+ if(!$addrinfo{$1}) {
+ print "freeaddrinfo() without getaddrinfo(): $line\n";
+ }
+ else {
+ $addrinfo{$1}=0;
+ $addrinfos--;
+ }
+ }
+
+
+ }
else {
print "Not recognized prefix line: $line\n";
}
@@ -203,6 +234,15 @@ if($fopens) {
}
}
+if($addrinfos) {
+ print "IPv6-style name resolve data left at:\n";
+ for(keys %addrinfofile) {
+ if($addrinfo{$_} == 1) {
+ print "getaddrinfo() called at ".$addrinfofile{$_}."\n";
+ }
+ }
+}
+
if($verbose) {
print "Mallocs: $mallocs\n",
"Reallocs: $reallocs\n",