使用用户模式转储确定 WinDbg 中的线程等待时间
WinDbg 有什么方法可以确定 Windows 线程从什么日期/时间开始被 WaitForSingleObjects
或 WaitForMultipleObjects
等函数阻塞?
我知道如何在内核调试中执行此操作(使用 !thread
),但我不知道如何在用户模式调试中执行此操作。
is there any way in WinDbg to determine since what date/time a Windows thread is blocked by functions like WaitForSingleObjects
or WaitForMultipleObjects
?
I know how to do this in kernel debugging (using !thread
), but I have no idea how to do this in user-mode debugging.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 WinDbg 中,您可以使用
!runaway
来获取线程计时:(用户时间)
(内核时间)
(经过时间)
(您会发现这些在某些地方记录为 0、1 和 2,但在根据我的经验,这些不起作用。也许这取决于 WinDbg 版本或其他东西...)
您可以通过从线程的运行时间中减去线程的用户和内核时间来计算挂起的时间,但不幸的是我不知道任何时间。方式(无需编写 WinDbg 插件)让 WinDbg 为您执行此操作。
如果您未设置 WinDbg,则可以使用 Process Explorer 获取相同的信息。当您右键单击进程并在属性对话框中选择线程选项卡时,您将获得该进程中所有线程的列表。选择特定线程将显示相同的计时信息等。
In WinDbg, you can use
!runaway
to get thread timings:(user time)
(kernel time)
(elapsed time)
(You'll find these documented as 0, 1 and 2 some places, but in my experience those don't work. Perhaps it depends on the WinDbg version or something...)
You can compute the time spent suspended by subtracting a thread's user and kernel time from it's elapsed time, but unfortunately I don't know of any way (short of writing a WinDbg plugin) to get WinDbg to do that for you.
If you're not set on WinDbg, you can use Process Explorer to get the same information. When you right-click a process and select the threads tab in the properties dialog, you get a list of all the threads in the process. Selecting a particular thread will show the same timing information, among other things.