如何使用 strace 只显示花费大量时间的调用?
有没有办法 grep 只查找特定时间内的调用?
Is there a way to grep for only calls that over a certain amount of time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有没有办法 grep 只查找特定时间内的调用?
Is there a way to grep for only calls that over a certain amount of time?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
看起来输出中有一个显示 CPU 时间的标志 (
-c
):man strace
示例输出:
当使用
-c
标志运行时,strace 似乎会保留所有输出,直到执行终止(优雅地或ctrl -c
)并使用
awk
查找 CPU 时间 == 0.0:It looks like there is a flag that shows the CPU time in the output (
-c
):man strace
Sample output:
When run with the
-c
flag, strace appears to hold all output until execution terminates (gracefully orctrl-c
)And with
awk
to look for CPU time == 0.0: