+
+# Macro: mbuf_walk_mleak_traces
+@lldb_command('mbuf_walk_mleak_traces')
+def MbufWalkMleakTraces(cmd_args=None):
+ """ Print mleak_traces
+ """
+ i = 0
+ while (i<256):
+ trace = kern.globals.mleak_traces[i]
+ out_string = ""
+ if (trace.allocs != 0):
+ print "Index: " + str(i)
+ out_string += ":" + str(trace.allocs) + " outstanding allocs\n"
+ out_string += str(trace.hitcount) + " hitcount\n"
+ out_string += str(trace.collisions) + " collisions\n"
+ out_string += "Backtrace saved " + str(trace.depth) + " deep\n"
+ if (trace.depth != 0):
+ cnt = 0
+ while (cnt < trace.depth):
+ out_string += str(cnt + 1) + ": "
+ out_string += GetPc(trace.addr[cnt])
+ out_string += "\n"
+ cnt += 1
+ print out_string
+ i +=1
+# EndMacro: mbuf_walk_mleak_traces
+