在 Linux 上分析挂墙时间 [英] Profiling for wall-time on Linux

查看:51
本文介绍了在 Linux 上分析挂墙时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,我想分析在各种活动中花费了多少时间.由于此应用程序是 I/O 密集型的,因此我希望得到一份报告,该报告将总结每个库/系统调用所花费的时间(挂墙时间).

I have an application that I want to profile wrt how much time is spent in various activities. Since this application is I/O intensive, I want to get a report that will summarize how much time is spent in every library/system call (wall time).

我尝试过 oprofile,但它似乎在未停止的 CPU 周期(即 cputime,不是实时)方面提供了时间

I've tried oprofile, but it seems it gives time in terms of Unhalted CPU cycles (thats cputime, not real time)

我已经尝试过 strace -T,它提供了时间,但是生成的数据非常庞大,并且很难获得摘要报告(并且存在用于此的 awk/py 脚本?)

I've tried strace -T, which gives wall time, but the data generated is huge and getting the summary report is difficult (and awk/py scripts exist for this ?)

现在我正在寻找 SystemTap,但我没有找到任何足够接近且可以修改的脚本,而且现场教程也没有太大帮助.我不确定我正在寻找的东西是否可以完成.

Now I'm looking upto SystemTap, but I don't find any script that is close enough and can be modified, and the onsite tutorial didn't help much either. I am not sure if what I am looking for can be done.

我需要有人为我指明正确的方向.非常感谢!

I need someone to point me in the right direction. Thanks a lot!

推荐答案

this 判断提交最近发布的 strace 4.9 支持:

strace -w -c

他们称之为系统调用延迟"(仅从联机帮助页中很难看出 -w 是做什么的).

They call it "syscall latency" (and it's hard to see from the manpage alone that's what -w does).

这篇关于在 Linux 上分析挂墙时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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