# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
-# Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
my $strdups=0;
my $wcsdups=0;
my $showlimit;
+my $sends=0;
+my $recvs=0;
+my $sockets=0;
while(1) {
if($ARGV[0] eq "-v") {
$filedes{$1}=1;
$getfile{$1}="$source:$linenum";
$openfile++;
+ $sockets++; # number of socket() calls
}
elsif($function =~ /socketpair\(\) = (\d*) (\d*)/) {
$filedes{$1}=1;
elsif($_ =~ /^GETNAME ([^ ]*):(\d*) (.*)/) {
# not much to do
}
+ # SEND url.c:1901 send(83) = 83
+ elsif($_ =~ /^SEND ([^ ]*):(\d*) (.*)/) {
+ $sends++;
+ }
+ # RECV url.c:1901 recv(102400) = 256
+ elsif($_ =~ /^RECV ([^ ]*):(\d*) (.*)/) {
+ $recvs++;
+ }
# ADDR url.c:1282 getaddrinfo() = 0x5ddd
elsif($_ =~ /^ADDR ([^ ]*):(\d*) (.*)/) {
if($verbose) {
print "Mallocs: $mallocs\n",
- "Reallocs: $reallocs\n",
- "Callocs: $callocs\n",
- "Strdups: $strdups\n",
- "Wcsdups: $wcsdups\n",
- "Frees: $frees\n",
- "Allocations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups)."\n";
+ "Reallocs: $reallocs\n",
+ "Callocs: $callocs\n",
+ "Strdups: $strdups\n",
+ "Wcsdups: $wcsdups\n",
+ "Frees: $frees\n",
+ "Sends: $sends\n",
+ "Recvs: $recvs\n",
+ "Sockets: $sockets\n",
+ "Allocations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups)."\n",
+ "Operations: ".($mallocs + $callocs + $reallocs + $strdups + $wcsdups + $sends + $recvs + $sockets)."\n";
print "Maximum allocated: $maxmem\n";
}