是有可能使用某些code片段VTUNE在二进制,而不是一个完整的二进制? [英] Is it possible to use vtune on certain code snippets in a binary and not an entire binary?

查看:206
本文介绍了是有可能使用某些code片段VTUNE在二进制,而不是一个完整的二进制?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加入一个小型图书馆的使用到大现有的软件,并想分析(取景器中的细节不仅仅是在和放大器;出RDTSC()或gettimeofday的调用)的开销和它的小型图书馆的归属。使用像RDTSC()我可以得到延迟的感觉,叫我的图书馆功能都有,但除非我也能看到树枝是否不被pdicted以及$ P $,缓存心不是工作正常,我不能做延迟归属, etc..I看着PAPI像我想象在看某个硬件事件进入和退出在做大二进制的背景下我的图书馆例行的,但似乎我需要一个特定的内核模块PAPI为我工作( Linux的2.6.18和放大器;&安培;英特尔至强5570)...有VTUNE这是专门针对英特尔处理器,但似乎这件事情这将分析的整个二进制的性能和不特定code段(3 -4调用到我的图书馆)。

I am adding usage of a small library to a large existing piece of software and would like to analyze (in finder detail than just in&out rdtsc() or gettimeofday calls) the overhead and it's attribution of the small library. Using things like rdtsc() I can get a sense of the latency that calling my libraries functions have, but I cannot do latency attribution unless I am also able to see whether branches are not being predicted well, caching isnt working properly, etc..I looked into PAPI as I imagined looking at a certain hardware events going into and out of a routine in my library within the context of the bigger binary but it seems I would need a specific kernel module for PAPI to work for me (Linux 2.6.18 && Intel Xeon 5570)...there is Vtune which is specifically geared for intel processors but it seems like it's something which would profile the entire binary for performance and not specific code snippets (the 3-4 calls into my library).

有没有办法,我用VTUNE我的目标,或可能东西能给我获得这样的柜台,而不必修补我的内核?

Is there a way for me to use Vtune for my goal, or possibly something which can give me access to such counters without having to patch my kernel?

推荐答案

这是不可能的VTUNE定义一个入口点开始录制。

It's not possible to define an entry point in vtune to start recording.

不过,你可以做什么,就是开始跟踪记录没有,然后当你希望打你的图书馆,你就开始跟踪并让它记录的调用。来电后,您可能会再次停止它,现在可以使用VTUNE上下方标签查找库调用。

However, what you can do, is to start the trace without recording and then when you expect to hit your library, you start the trace and let it record the calls. After the calls, you may stop it again and can now look up the library call using the top-bottom tab in vtune.

有了它,你应该能够看到所有有关通话信息,并在每所花费的时间。

With it, you should be able to see all the information regarding the calls, and the time spent in each.

如果你想确保你只有在呼叫活动跟踪,你可以访问并留下您要进行检查,然后启动和适当停止探查的职能时启动gdb下的应用程序,并插入断点。

If you want to be sure that you only trace while the calls are active, you may start the application under gdb and insert breakpoints when accessing and leaving the functions you wish to examine and then start and stop the profiler appropriately.

这篇关于是有可能使用某些code片段VTUNE在二进制,而不是一个完整的二进制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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