任何关于动态代码分析的参考? [英] Any references on Dynamic Code Analysis?

查看:32
本文介绍了任何关于动态代码分析的参考?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我正在阅读有关调试技​​术的文章,发现 Valgrind 非常有趣.它似乎使用了动态代码分析的技术.我按照原始参考中的链接指向其他称为 Path Profiling.

Yesterday I was reading about debugging techniques and found Valgrind to be really interesting. It seems to use techniques from dynamic code analysis. And I followed a link from the original reference to something else called Path Profiling.

我尝试过谷歌搜索,但我想我使用了错误的术语来搜索有关这些概念的良好参考.考虑到我没有编译器和编程语言的背景,有人可以推荐一个好的资源吗?

I tried Googling but I guess I am using the wrong terms to search for a good reference on these concepts. Can someone suggest a good resource taking into account that I do not have a background in compilers and programming languages?

推荐答案

Path Profiling 作为一个理论问题很有趣.gprof 也很有趣,因为它处理调用图、循环子图等.有很好的算法来处理这些信息并在整个结构中传播测量值.

Path Profiling is interesting as a theoretical problem. gprof is also interesting, because it deals in call graphs, cyclical subgraphs, and such. There are nice algorithms for manipulating this information and propogating measurements throughout a structure.

所有这些都可能会诱使您认为它有效(尽管他们从未说过它确实有效)- 用于查找一般性能问题.

All of which might tempt you to think it works (though they never say it does) - for finding general performance problems.

但是,假设您的程序挂起.你是如何发现问题的?

However, suppose your program hangs. How do you find the problem?

我所做的是让它进入无限循环,然后中断(暂停)它以查看它在做什么.我查看了调用堆栈每个级别的代码,因为我知道循环位于堆栈中的某个位置.如果它不明显,我只是继续前进,直到我看到它重复出现,然后我知道问题出在哪里.我怀疑几乎任何人都会这样做.

What I do is get it into the infinite loop, and then interrupt (pause) it to see what it's doing. I look at the code on each level of the call stack, because I know the loop is somewhere on the stack. If it's not obvious, I just step it along until I see it repeating itself, and then I know where the problem is. I suspect almost anyone would do that.

事实上,如果在程序运行时间过长的情况下停止程序并多次检查其状态,您不仅可以找到无限循环,而且几乎可以找到程序运行时间超过您希望的任何问题.

In fact, if you stop the program while it's taking too long and examine its state several times, you can not only find infinite loops, but almost any problem where the program runs longer than you would like.

有基于此概念的分析器工具,例如 ZoomLTProf,但就我而言,没有什么比彻底理解代表性快照更能提供洞察力了.

There are profiler tools based on this concept, such as Zoom and LTProf, but for my money nothing gives as much insight as thoroughly understanding representative snapshots.

您不会找到有关此技术的好的参考资料,因为(奇怪的是)没有多少人知道它,而且发布起来太简单了.

You won't find good references on this technique because (oddly) not many people are aware of it, and it's too simple to publish.

关于这个主题还有很多要说的.

实际上,FWIW,我发布"了一篇关于它的文章,但它只是经过编辑审查,我认为没有人真正阅读过它:Dunlavey,性能调优与调用衍生的指令级成本-堆栈采样",ACM SIGPLAN Notices 42, 8(2007 年 8 月),第 4-8 页.

Actually, FWIW, I "published" an article on it, but it was only reviewed by an editor, and I don't think anyone's actually read it: Dunlavey, "Performance tuning with instruction-level cost derived from call-stack sampling", ACM SIGPLAN Notices 42, 8 (August, 2007), pp. 4-8.

这篇关于任何关于动态代码分析的参考?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆