Created
September 27, 2017 16:04
-
-
Save niedbalski/fc78f1dd960a08928dbf2e0a8f0997e4 to your computer and use it in GitHub Desktop.
strace-radosgw.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
trace_dir=${2:-trace} | |
if [ ! -e ${trace_dir} ]; then | |
mkdir ${trace_dir} | |
fi | |
function ctrl_c() { | |
killall -9 strace && exit 0; | |
} | |
function monitor() { | |
while true; do | |
strace $(pgrep radosgw | awk '{print"-p " $1}') -t -f -o ${trace_dir}/strace | |
sleep .5 | |
done | |
} | |
trap ctrl_c INT | |
monitor |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment