.Net 分析 API 方法
我有一种感觉,我可能已经知道这个问题的答案,但我还是会问。
是否有比 COM/托管 C++ 路线更好的使用 .Net Profiling API 的方法?
我不愿意遵循建议的 COM 方法是这样的:
- 努力,开始需要大量的跑腿工作
- 不喜欢连接 C++ dll 所涉及的魔力,不容易通过项目重新分发
- 感觉很难进行单元测试
- 不想要在 C++ 中表现。 我可以创建一个互操作层,但这更加
- 难以调试。 根据我收集的信息,您无法将调试器附加到实际的 C++ 层,因此您回到日志文件,这样
我遇到了一个名为 NProf,这是用托管层包装 API 的尝试。 不幸的是,它自 2003 年以来就没有更新过。
有人有任何可能有帮助的线索吗? 这一切都让人感觉有点恶心。
说明:
- 这描述了我所指的 API:分析 API
- 我正在使用 Visual Studio 2008 和 v3.5 框架
I have a feeling I may already know the answer to this question, but I'll ask it anyway.
Are there any better ways of using the .Net Profiling API than the COM/Managed C++ route?
My reluctance to follow the suggested COM approach is as such:
- Effort, it's a lot of legwork to get started
- Don't like the magic involved in hooking up the C++ dlls, not easy to redistribute with projects
- Feels hard to unit test
- Don't want to behavior in C++. I could create an interop layer, but that's even more work
- Hard to debug. From what I've gathered you can't attach a debugger to the actual C++ layer, so you're back to log files and such
I came across a project called NProf, which was an attempt to wrap the API with a managed layer. Unfortunately it hasn't been updated since 2003.
Does anyone have any leads that might help? This all just feels a bit nasty.
Clarifications:
- This describes the API I'm referring to: The Profiling API
- I'm using Visual Studio 2008, and v3.5 of the framework
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以看一下部分封面。 它是一个代码覆盖工具 (GPL),但其工作原理与 NCover 类似,这意味着它使用分析 API 来完成其工作。 不确定代码有多好或多坏,以及它对您有多大帮助(GPL 也可能是一个问题),但您可能想看一下。 它在去年年底更新过,然后就沉寂了,所以我不确定该项目是否仍然活跃。
You can take a look at Part-Cover. It's a code coverage tool (GPL) but it works similarly to NCover, which means it uses profiling API to do its job. Not sure how good or bad the code is, and of how much help it'll be for you (GPL may be an issue as well), but its something you may want to take a look at. It's been updated late last year and then went silent, so I'm not sure if the project is still active.
分析是一个非常低级别且性能敏感的领域,因此它作为低级别 API 公开。 我认为这正是这种功能的领域。
您能否详细说明调试问题...您应该能够将非托管调试器附加到您正在分析的托管可执行文件,并使用它来调试分析器 dll。
Profiling is a very low level and performance sensitive area, hence it is exposed as a low level API. I think this just comes with the territory for this kind of functionality.
Can you elaborate on the debug issue ... you should be able to attach an unmanaged debugger to the managed executable you are profiling and use that to debug your profiler dll.