Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

390
Vistas
Linux "Perf" tool cannot run inside docker images?

I knew that "perf" tool requires installation correspond to specific linux kernel versions. And I knew that all docker images run with the same linux kernel version, no matter linux distribution version.

I'm using ubuntu 16.04 inside docker and already installed linux-tools-common, start perf tell me I still lack some packages:'

# perf
/usr/bin/perf: line 32: lsb_release: command not found
WARNING: perf not found for kernel 4.9.12

  You may need to install the following packages for this specific kernel:
    linux-tools-4.9.12-moby
    linux-cloud-tools-4.9.12-moby

  You may also want to install one of the following packages to keep up to date:
    linux-tools-moby
    linux-cloud-tools-moby

Then I tried to install what I missed:

root@xxxxxx:/# apt-get install linux-tools-4.9.12-moby linux-cloud-tools-4.9.12-moby
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-tools-4.9.12-moby
E: Couldn't find any package by glob 'linux-tools-4.9.12-moby'
E: Couldn't find any package by regex 'linux-tools-4.9.12-moby'
E: Unable to locate package linux-cloud-tools-4.9.12-moby
E: Couldn't find any package by glob 'linux-cloud-tools-4.9.12-moby'
E: Couldn't find any package by regex 'linux-cloud-tools-4.9.12-moby'
root@b2543b6e985d:/# apt-get install linux-tools-moby linux-cloud-tools-moby
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-tools-moby
E: Unable to locate package linux-cloud-tools-moby

(1) So weird, but how to solve this installation problem?

(2) Plus: I'm still confused, if there's no strict match between "perf" and "kernel", how could "perf" work well inside docker of linux?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I knew that "perf" tool requires installation correspond to specific linux kernel versions. And I knew that all docker images run with the same linux kernel version, no matter linux distribution version.

Perf tool from other version of kernel still can be used (the syscalls in perf_event subsystem have good design and are compatible with older/newer tools). So, you can just find any perf binary (not the /usr/bin/perf script) anywhere, check its library depends with (ldd ..path_to_perf/perf) and copy perf inside Docker (and install libs).

Usage of hardware events, system-wide or kernel profiling may be limited in the docker, so try

  • perf -e cycles:u ./program (hardware counter only for user-space),
  • perf -e task-clock ./program (software timer for kernel and user-space),
  • perf -e task-clock:u ./program (software timer for user-space only),
about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda