生产调试:是否有比 WinDbg 侵入性更小的方法?
我想知道是否有一种侵入性较小的方法来分析生产环境中正在运行的托管流程。
侵入性较小的含义:
- 附加调试器时没有执行延迟。
- 获取运行线程等基本统计信息时不会出现执行延迟。
在Java世界里有这样一个工具,它是JDK的一部分。我想知道 .NET 世界中是否有类似的工具。
该工具应该回答以下问题:
- 线程池参数是什么?与 Windbg 中的“!threadpool”相同。
- 我当前运行的线程的调用堆栈是什么(是的,您可以从 Java 工具获取它:))。
- 基本堆分析,例如有多少个 ABC 类型的对象。
有什么想法吗?
亚历克斯
I was wondering if there is a less intrusive way to analyze a running, managed process in production environments.
Less intrusive meaning:
- No delay of execution when attaching the debugger.
- No delay of execution when getting basic stats like running threads.
In the Java world there is a such a tool part of the JDK. I was wondering if there're similar tools in the .NET world.
The tool should answer questions like:
- What are the thread pool parameters? Same as "!threadpool" in Windbg.
- What are the callstacks of my currently running threads (yep, you get it from the Java tool :) ).
- Basic heap analysis e.g. howmany objects of type ABC.
Any ideas?
Alex
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果我理解正确的话,您不想实际调试程序,只想获取一些基本信息。在这种情况下,Process Explorer 可能就足够了。
If I understand you correctly, you don't want to actually debug the program, only get some basic information. In such cases, Process Explorer may be sufficient.
正如 Oefe 所说,您可以从 Process Explorer 获取大量信息,包括所有线程的堆栈。此外,.NET 运行时还有许多有用的性能计数器,这可能会给您一些见解。如果您有特殊需求,您的应用程序可以发布自己的计数器。
As Oefe says, you can get a lot of info including the stacks of all threads from Process Explorer. Also, the .NET runtime has a number of useful performance counters, that may give you some insight. If you have special needs, your application can publish its own counters.
这是使用 ETW 和另一个
Here is production debugging in a non-intrusive manner using ETW and another one
这取决于你想要调试什么。 WinDbg 是 Windows 调试的巨锤,适合调试从内核扩展开始的任何内容。
如果您只想调试程序,大多数人只使用 Visual Studio,它将附加到正在运行的进程。
然而,@oefe 可能对此感到不放心。当大多数人说“调试器”时,他们想要回溯和断点等。在 Java 中,您需要事先安排以附加此类调试器。 Windbg 或 Visual Studio (-debugexe) 都比这更方便。
It depends on what you want to debug. WinDbg is the giant hammer of Windows debugging, suitable for debugging anything from kernel extensions on up.
If you just want to debug a program, most people just use visual studio, which will attach to a running processs.
However, @oefe may have the bull by the horns here. When most people say 'debugger' they want backtraces and breakpoints and such. In Java, you need to make prior arrangements to attach that sort of debugger. Either Windbg or visual studio (-debugexe) is more convenient than that.