Skip to content

Instantly share code, notes, and snippets.

@niedbalski
Created September 27, 2017 16:04
Show Gist options
  • Save niedbalski/fc78f1dd960a08928dbf2e0a8f0997e4 to your computer and use it in GitHub Desktop.
Save niedbalski/fc78f1dd960a08928dbf2e0a8f0997e4 to your computer and use it in GitHub Desktop.
strace-radosgw.sh
#!/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