非 sudo perf sched 总是失败,并显示“跟踪数据损坏或丢失”

非 sudo perf sched 总是失败,并显示“跟踪数据损坏或丢失”

在我的 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 命令有什么问题吗?

相关内容