jvm-profiling-tools / perf-map-agent

A java agent to generate method mappings to use with the linux `perf` tool
GNU General Public License v2.0
1.65k stars 260 forks source link

only sudo if you aren't already the user running the jvm process #76

Open tekumara opened 5 years ago

tekumara commented 5 years ago

this enables usage inside docker containers that don't contain sudo, when running docker exec as the user running the jvm process

eg: when perf-map-agent is installed at /perf-map-agent/ inside a container running a single jvm process as user daemon, create a perf-map in the container's /tmp as follows:

docker exec -it --user daemon CONTAINER sh -c '/perf-map-agent/bin/create-java-perf-map.sh $(pidof java)'

NB: the pid of the perf map will be the pid in the container's namespace, not the host's.

hopefully addresses concerns in https://github.com/jvm-profiling-tools/perf-map-agent/pull/18

tekumara commented 5 years ago

@jrudolph are you able to remove this?