Skip to content

Instantly share code, notes, and snippets.

@chbatey
Created October 31, 2016 16:36
Show Gist options
  • Save chbatey/e222f62a5a0f44b31f88bcd83bc2f6cd to your computer and use it in GitHub Desktop.
Save chbatey/e222f62a5a0f44b31f88bcd83bc2f6cd to your computer and use it in GitHub Desktop.
#!/usr/bin/bash -x
container=$1
host_pid=$2
container_pid=$(docker exec $container jps | grep -v Jps | cut -f 1 -d " ")
echo "Container PID: $container_pid"
docker exec $container /perf-map/bin/create-java-perf-map.sh $container_pid docker exec $container cat /tmp/perf-${container_pid}.map -- > /tmp/perf-${host_pid}.map
sudo chown root:root /tmp/perf-${host_pid}.map
sudo perf top -p $host_pid
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment