在我的 Ubuntu 22.04 (5.19.0-35-generic) 上,似乎perf sched
无法解析自己的perf.data
输出。按照Brendan Gregg 的博客,录音效果很好
# perf sched record -- sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 2.844 MB perf.data (11439 samples) ]
但是,我读取分析数据的任何尝试都失败了:
# perf script --header
incompatible file format (rerun with -v to learn more)
# perf sched script
incompatible file format (rerun with -v to learn more)
# perf sched latency
incompatible file format (rerun with -v to learn more)
# perf sched map
incompatible file format (rerun with -v to learn more)
详细输出仅告诉broken or missing trace data
:
# perf script -v --header
build id event received for [kernel.kallsyms]: 77ab8542b6540fae3367bbb18a7aeede3c3b6f7b [20]
build id event received for [vdso]: f33b8f26bed889157b75129711599f9ca5ec9d0e [20]
broken or missing trace data
incompatible file format (rerun with -v to learn more)
谷歌搜索了一下,我只找到旧错误报告,但他们的解决方法并不适用于我的情况:
# perf script --header -i - < perf.data
incompatible file format (rerun with -v to learn more)
此外,我发现运行相同的命令可以sudo
正常工作:
# sudo perf sched record -- sleep 1
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 3.875 MB perf.data (19424 samples) ]
# sudo perf script --header
<output>
知道非 sudo 命令有什么问题吗?