我应该用什么分析器来测量_real_ time(包括等待系统调用)花在这个函数上,而不是_CPU_一个 [英] What profiler should I use to measure _real_ time (including waiting for syscalls) spend in this function, not _CPU_ one

查看:144
本文介绍了我应该用什么分析器来测量_real_ time(包括等待系统调用)花在这个函数上,而不是_CPU_一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序不计算内容,但是i / o,读取文件,使用网络。我希望探查器能够显示它。

The application does not calculate things, but does i/o, read files, uses network. I want profiler to show it.

我希望像callgrind这样的东西会调用clock_gettime每个问题。

I expect something like something like in callgrind that calls clock_gettime each proble.

或者喜欢oprofile 中断我的应用程序(当它正在睡觉或等待socket / file /等等)时,看看它在做什么。

Or like oprofile that interrupts my application (while it is sleeping or waiting for socket/file/whatever) to see what is it doing.

我想要读取,连接,nanosleep,发送,特别是fsync(及其所有来电者)之类的内容为粗体(不是像字符串或数字函数那样的东西)执行计算)。

I want things like "read", "connect", "nanosleep", "send" and especially "fsync" (And all their callers) to be bold (not things like string or number functions that perform calculations).

平台:GNU / Linux @ i386

Platform: GNU/Linux @ i386

推荐答案

快速破解Linux的简单采样分析器: http://vi-server.org/vi/simple_sampling_profiler .html

Quickly hacked up trivial sampling profiler for linux: http://vi-server.org/vi/simple_sampling_profiler.html

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

It appends backtrace(3) to a file on SIGUSR1, and then converts it to annotated source.

因为它定期探测程序,我们会看到fu那些等待某事的东西。

As it probes the program periodically, we'll see functions that waits for something.

当它走过堆栈时,我们也会看到来电者。

And as it walks the stack, we'll see callers too.

同样来自类似问题答案的人建议使用Zoom。

Also people from answers to similar questions recommends Zoom.

这篇关于我应该用什么分析器来测量_real_ time(包括等待系统调用)花在这个函数上,而不是_CPU_一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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