我使用 linux perf (perf_events) 生成带有时间戳的 perf.data 文件。
如何生成子时间间隔 [i-start, i-end] 内所有事件的报告?
我可以将 perf.data 缩小为仅包含 [i-start, i-end] 中的事件的 perf_subinterv.data 文件吗?
我需要这样做来分析每 5 分钟左右表现不佳的短时间间隔(2 秒 - 6 秒)。
Most perf
工具,包括perf report
,支持按时间过滤:
--time::
Only analyze samples within given time window: <start>,<stop>. Times
have the format seconds.microseconds. If start is not given (i.e., time
string is ',x.y') then analysis starts at the beginning of the file. If
stop time is not given (i.e, time string is 'x.y,') then analysis goes
to end of file.
欲了解更多详情,请参阅man perf-report.
这是从 4.10 版(2017 年 2 月)开始出现的。如果您运行较旧的内核,您可以尝试构建用户空间工具部分perf
你自己。在更新的版本中,可以指定时间百分比和多个时间范围。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)