Closed sattishv closed 5 years ago
@sattishv, this is a good question. There seem to be several issues around running perf-map-agents in containers. The simplest way is probably installing perf-map-agent inside the container and then spawning another shell in the same container and then running the scripts as usual. As others have reported this needs sudo to work inside the container.
A nicer solution would be to be able to run perf and perf-map-agent from outside the container. As far as I have tried that there seem to be several issues around that with PIDs not matching inside and outside the container etc. It would be nice if someone would get this to work. It might be that this feature would need specific support from perf itself.
Here's information about how to do that:
Though, afaik, it hasn't been achieved yet to run perf-map-agent outside of the container.
I managed to run the attach script from the host namespace. I haven't properly integrated that as it needs some hacking of internals from tools.jar. Right now it will only work if the target process has PID 1 in the container.
See https://github.com/jvm-profiling-tools/perf-map-agent/compare/jr/attach-to-container-from-host
Let's close this one as a duplicate of #50.
Hi team,
We have our application running inside a container. If thats the case the map-agent should be installed outside or inside the container. I presume it should be done inside the container because the jdk we use is referenced inside. Could you please review and let us know the ideal approach.
Sattish.