X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/3e170ce000f1506b7b5d2c5c7faec85ceabb573d..ecc0ceb4089d506a0b8d16686a95817b331af9cb:/tools/lldbmacros/process.py diff --git a/tools/lldbmacros/process.py b/tools/lldbmacros/process.py index b4c85f918..e2ddb8e3d 100644 --- a/tools/lldbmacros/process.py +++ b/tools/lldbmacros/process.py @@ -1026,6 +1026,21 @@ def DumpCallQueue(cmd_args=None): #EndMacro: dumpcallqueue +@lldb_command('showalltasklogicalwrites') +def ShowAllTaskIOStats(cmd_args=None): + """ Commad to print I/O stats for all tasks + """ + print "{0: <20s} {1: <20s} {2: <20s} {3: <20s} {4: <20s} {5: <20s}".format("task", "Immediate Writes", "Deferred Writes", "Invalidated Writes", "Metadata Writes", "name") + for t in kern.tasks: + pval = Cast(t.bsd_info, 'proc *') + print "{0: <#18x} {1: >20d} {2: >20d} {3: >20d} {4: >20d} {5: <20s}".format(t, + t.task_immediate_writes, + t.task_deferred_writes, + t.task_invalidated_writes, + t.task_metadata_writes, + str(pval.p_comm)) + + @lldb_command('showalltasks','C') def ShowAllTasks(cmd_args=None, cmd_options={}): """ Routine to print a summary listing of all the tasks @@ -1236,7 +1251,7 @@ def SwitchToRegs(cmd_args=None): fake_thread_id = 0xdead0000 | (saved_state & ~0xffff0000) fake_thread_id = fake_thread_id & 0xdeadffff lldb_process.CreateOSPluginThread(0xdeadbeef, saved_state) - lldbthread = lldb_process.GetThreadByID(fake_thread_id) + lldbthread = lldb_process.GetThreadByID(int(fake_thread_id)) if not lldbthread.IsValid(): print "Failed to create thread"