创建新的 .Net Profiler Api

发布于 2024-08-28 14:31:12 字数 458 浏览 3 评论 0原文

我是 .Net Profiler 和 Visual C++ 的新程序员,

我阅读了许多关于 .Net Profiling 的论坛和博客,我有这个问题。

我的 Profiler 应用程序必须是非托管代码,或者我可以在我的应用程序中使用 .Net 中的某些类吗?我必须使用 MFC 创建 ATL 或..什么类型的项目?

另一个问题是我如何注册我的探查器 dll 文件,以便我的计算机的每个应用程序都使用此探查器?

重写方法的 IL 的最佳情况在哪里(Profiler 的 Enter 方法或 JITCompilationStarted)?

如何获取旧方法的输入变量并将其发送到新方法?

我如何更改属性或整个类的 IL?

我想要更改我的 dll 的所有日期时间格式,并且我认为我必须在 JITCompilationStarted 中搜索这些方法的名称,然后重写该方法,你有更好的解决方案吗?多谢。

i m a new programmer in .Net Profiler and Visual C++,

i read many forums and weblogs for .Net Profiling and i have this question.

my Profiler application must be a unmanaged code or i can use some class in .Net in my application? and what type of project i must create ATL with MFC Or ..?

another question is how can i register my profiler dll file that every application of my computer use this profiler?

where the best situation for re-write IL of a method (Enter method of profiler or JITCompilationStarted)?

how can i get input variables of old method and send to new method?

how can i change IL of a property or whole of a class?

i want chane all datetime format of my dlls, and i think that i must search name of those method in JITCompilationStarted and then rewrite that methods,Do u have any better solution? thanks alot.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑咖 2024-09-04 14:31:12

很高兴您想尝试一下。我建议您了解一些关于分析的旧想法没有多大帮助 ,并尝试改进它们。

我建议主要关注点应该放在代码行上,而不是函数上,并且最有用的统计数据是,对于每一行,它负责的时间百分比(即在调用堆栈)。 (获取百分比的优点是,您不必关心事情需要多长时间,它们被调用多少次,或者它们是否与其他进程竞争。)

我认为获取该信息的最佳方法是通过堆叠在随机挂钟时间采集的样本。不要仅仅因为样本在程序被阻止时出现而将其排除,除非您不想看到不必要的 I/O。一个好的方法是让用户打开/关闭采样,这样在等待用户输入时就不会采集大量样本。

采用这种方法的优秀分析器的一个示例是 RotateRight/Zoom。祝你好运。

It is good that you want to try this. I would suggest that you be aware of some old ideas about profiling that are less than helpful, and try to improve on them.

I would suggest that the primary focus should be on lines of code, not functions, and that the most useful statistic to get is, for each line, the percent of time it is responsible for (i.e. on the call stack). (The advantage of getting percentage is that you don't have to care how long things take, how many times they are invoked, or whether they are competing with other processes.)

I think the best way to get that information is by means of stack samples taken at random wall-clock times. Don't exclude samples just because they occur when the program is blocked, unless you want to be blind to needless I/O. A good approach is to let the user turn sampling on/off, so you don't take a lot of samples while waiting for user input.

An example of a good profiler that takes this approach is RotateRight/Zoom. Good luck.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文