2 # Awk program to analyze mtrace.c output.
4 $1 == "+" { if (allocated[$2] != "")
5 print "+", $2, "Alloc", NR, "duplicate:", allocated[$2];
9 $1 == "-" { if (allocated[$2] != "") {
11 if (allocated[$2] != "")
12 print "DELETE FAILED", $2, allocated[$2];
14 print "-", $2, "Free", NR, "was never alloc'd";
16 $1 == "<" { if (allocated[$2] != "")
19 print "-", $2, "Realloc", NR, "was never alloc'd";
21 $1 == ">" { if (allocated[$2] != "")
22 print "+", $2, "Realloc", NR, "duplicate:", allocated[$2];
29 # Ignore failed realloc attempts for now
33 END { for (x in allocated)
34 if (allocated[x] != "")
35 print "+", x, allocated[x];