为什么性能测试“对象代码读取”失败?

问题描述

当我运行 perf test 时,一个在 Ubuntu 21.04 Docker 容器中失败但在其 Ubuntu 21.04 主机上成功的测试是 26: Object code reading。似乎它可能与容器中的某些性能问题有关,例如dwarf 展开根本不起作用。

详细输出

26: Object code reading                                             :
--- start ---
test child forked,pid 92383
maps__set_modules_path_dir: cannot open /lib/modules/5.11.0-22-generic dir
Problems setting modules path maps,continuing anyway...
maps__set_modules_path_dir: cannot open /lib/modules/5.11.0-22-generic dir
Problems setting modules path maps,continuing anyway...
Looking at the vmlinux_path (8 entries long)
Failed to open /proc/kcore. Note /proc/kcore requires CAP_SYS_RAWIO capability to access.
/proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module!
/proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module!
Using /proc/kallsyms for symbols
Parsing event 'cycles:u'
mmap size 528384B
Reading object code for memory address: 0x7fd8f3dececb
File is: /usr/lib/x86_64-linux-gnu/libc-2.33.so
On file address is: 0x10decb
test child finished with -1
---- end ----
Object code reading: Failed!

测试究竟测试什么,为什么它在容器内失败?我正在使用 --privileged 运行 Docker。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)