Scenario / Questions

I am running Kubernetes on CentOS 7, and it doesn’t seem that the version of perf is namespace aware.

If run perf on the PID on the host node (host node found with kubectl describe pods --namespace) 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 exe (a Go exe that includes the symbols) to the expected path on the host node (either with kubectl cp ..., or by finding the file under overlay2 in /var/lib/docker) then perf top -p <pid> works from the host host node since it can find the same symbols that match the exe in the container.

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