3 # Awk program to analyze mtrace.c output.
5 $1 == "+" { if (allocated[$2] != "")
6 print "+", $2, "Alloc", NR, "duplicate:", allocated[$2];
10 $1 == "-" { if (allocated[$2] != "") {
12 if (allocated[$2] != "")
13 print "DELETE FAILED", $2, allocated[$2];
15 print "-", $2, "Free", NR, "was never alloc'd";
17 $1 == "<" { if (allocated[$2] != "")
20 print "-", $2, "Realloc", NR, "was never alloc'd";
22 $1 == ">" { if (allocated[$2] != "")
23 print "+", $2, "Realloc", NR, "duplicate:", allocated[$2];
30 # Ignore failed realloc attempts for now
34 END { for (x in allocated)
35 if (allocated[x] != "")
36 print "+", x, allocated[x];