使用 perf 从主机分析容器内的进程

发布于 2025-01-17 23:21:03 字数 252 浏览 4 评论 0原文

我在 CentOS 7 上运行 docker 容器。 如果在主机节点上的 PID 上运行 perf,我会收到有关未找到符号的错误。这似乎是因为它在主机节点的文件系统上查找相对于容器的文件路径。

如果我将所需的二进制文件复制到主机节点上的预期路径,则 perf 从主机节点工作,因为它可以找到与容器中的二进制文件匹配的相同符号(尽管不可能在主机上创建等效路径来匹配)全部)。

是否有更好/更干净的方法来针对 CentOS 7 主机的容器中运行的进程运行 perf?

I am running docker containers on CentOS 7.
If run perf on the PID on the host node I get an error about symbols not being found. This seems to be because it looks for the path of the file relative to the container but on the host node's filesystem.

If I copy the required binary files to the expected path on the host node then perf works from the host node since it can find the same symbols that match the binary files in the container (though it's not possible to create equivalent paths on host to match all).

Is there a better/cleaner way to run perf against a process running in a container with a CentOS 7 host?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文