是否可以在docker容器中运行linux perf工具 [英] is it possible to run linux perf tool inside docker container

查看:543
本文介绍了是否可以在docker容器中运行linux perf工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从容器中发出以下命令,发现以下问题,可能是由于"-moby"内核版本引起的.我们不能在Linux内核版本中获得没有单词"-moby"的docker镜像.

I tried giving the below command from container and found the below issue, may be because of "-moby" kernel version. Can't we get a docker image without word "-moby" coming in linux kernel version.

我尝试在具有ubuntu的VM上安装linux perf工具,并且该工具正常工作.

I tried installing linux perf tool on VM having ubuntu and it worked.

#docker run -t -i ubuntu:14.04 /bin/bash

root@214daea94f4f:/# perf

WARNING: perf not found for kernel 4.9.41

You may need to install the following packages for this specific kernel:

linux-tools-4.9.41-moby
linux-cloud-tools-4.9.41-moby

You may also want to install one of the following packages to keep up to date:

linux-tools-moby-lts-<series>
linux-cloud-tools-moby-lts-<series>

推荐答案

做到这一点

apt-get install linux-tools-generic

并建立到/usr/bin/perf的符号链接. (以我为例):

and make a symbolic link to /usr/bin/perf. (in my case):

ln -s /usr/lib/linux-tools/3.13.0-141-generic/perf /usr/bin/perf

对我有用!

这篇关于是否可以在docker容器中运行linux perf工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆