English 中文(简体)
我应该使用什么探查器来测量在该函数中花费的_real_time(包括等待系统调用),而不是_CPU_one
原标题:What profiler should I use to measure _real_ time (including waiting for syscalls) spend in this function, not _CPU_ one

该应用程序不计算东西,而是进行i/o、读取文件、使用网络。我想让探查器显示它。

我期待着类似于callgrind中的东西,它会在每个问题上调用clock_gettime。

或者像oprofile一样,会中断我的应用程序(当它正在休眠或等待socket/file/什么的时候),看看它在做什么。

我希望“读取”、“连接”、“nanosleep”、“发送”,尤其是“fsync”(及其所有调用方)之类的内容都是粗体(而不是执行计算的字符串或数字函数)。

平台:GNU/Linux@i386

最佳回答

快速破解linux的琐碎采样探查器:http://vi-server.org/vi/simple_sampling_profiler.html

它将backtrace(3)附加到SIGUSR1上的文件中,然后将其转换为带注释的源代码。

当它周期性地探测程序时,我们将看到等待某些东西的函数。

当它遍历堆栈时,我们也会看到调用者。

同样,有类似问题答案的人推荐Zoom。

问题回答

如果不了解你的平台和更多你想做的事情,就没有真正的方法来回答这个问题。

当我在英特尔平台上运行时,我喜欢使用时间戳计数器(RDTSC)。在亚微秒范围内很难击败资源。我只是在一段代码之前和之后调用它,并比较差异。





相关问题
Java: Comparing memory heap dumps in Netbeans

How do I compare memory heap dumps in Netbeans? What I have done is to configure my project to use profiling, then added several profiling points at chosen lines of code (similar to setting ...

Tools to evaluate callgrind s call profiles?

Somehow related to this question, which tool would you recommend to evaluate the profiling data created with callgrind? It does not have to have a graphical interface, but it should prepare the ...

Java: Finding out what is using all the memory

I have a java application that runs out of memory, but I have no idea which code is allocating the memory. Is there an application with which I can check this? I use Eclipse.

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Profiling Vim startup time

I’ve got a lot of plugins enabled when using Vim – I have collected plugins over the years. I’m a bit fed up with how long Vim takes to start now, so I’d like to profile its startup and see which of ...

热门标签