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

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

问题描述

昨天我正在阅读有关调试技​​巧,发现Valgrind非常有趣。它似乎使用动态代码分析技术。而且我从原来的引用跟着一个名为路径分析



我尝试过Google搜索,但是我想使用错误的术语来搜索这些概念的很好的参考。有人建议一个好的资源,考虑到我没有编译器和编程语言的背景?

解决方案

路径分析是一个有趣的理论问题。 gprof 也很有趣,因为它处理调用图,循环子图等。有一些很好的算法可以在整个结构中操纵这些信息和传播测量。



所有这些都可能诱使你认为它有效(虽然他们从来没有说过) - 发现一般性能问题。



但是,假设您的程序挂起。你如何找到问题?



我所做的是把它变成无限循环,然后中断(暂停)看看它在做什么。我看看调用堆栈的每个级别的代码,因为我知道循环是堆栈的某处。如果不明显,我只是一步一步,直到我看到它重复,然后我知道问题在哪里。我怀疑几乎任何人都会这样做。



事实上,如果您停止该程序太长时间并检查其状态多次,您不仅可以找到无限循环,但几乎任何程序运行时间比您想要的任何问题。



有基于这个概念的分析工具,例如缩放 LTProf 但是对于我的钱,没有什么比透彻理解代表性的快照更多的洞察力。



你不会在这种技术上找到很好的参考,因为(奇怪的是)没有多少人知道的,这太简单了。



有更多的话要说这个话题。






其实,FWIW,我发表一篇文章,但它是只有由编辑审查,我不认为任何人实际读:Dunlavey,性能调整与指令级成本源自调用堆栈抽样,ACM SIGPLAN通知42,8(2007年8月),第4页-8。


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 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.

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.

There's considerably more to say on the subject.


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天全站免登陆