Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to run perf-map-agent against Docker containers #40

Closed
sattishv opened this issue Aug 23, 2016 · 4 comments
Closed

Document how to run perf-map-agent against Docker containers #40

sattishv opened this issue Aug 23, 2016 · 4 comments

Comments

@sattishv
Copy link

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.

@jrudolph jrudolph changed the title How to install perf-map-agent on Docker containers Document how to run perf-map-agent against Docker containers Dec 17, 2016
@jrudolph
Copy link
Member

@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.

@jrudolph
Copy link
Member

jrudolph commented Nov 1, 2018

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.

@jrudolph
Copy link
Member

jrudolph commented Feb 19, 2019

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

@jrudolph
Copy link
Member

Let's close this one as a duplicate of #50.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants