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

sudo to target process UID #28

Closed phraktle closed 7 years ago

phraktle commented 8 years ago

When the user of the PID to attach to is not a sudoer, one would expect to be able to run the scripts as root (or as a different sudoer user). However due to the JDK bug https://bugs.openjdk.java.net/browse/JDK-8036559, root cannot attach to the JVM of another user. To address this, I’ve added a sudo to the target user, so the scripts can be run as root (or another sudoer). This should be a no-op if you are already that user.

jrudolph commented 7 years ago

Thanks, @phraktle. Good change. Sorry for keeping it so long in the queue, incredible that it now has been a year.