Back to home page

Redis cross reference

 
 

    


0001 # This script is from http://poormansprofiler.org/
0002 
0003 #!/bin/bash
0004 nsamples=1
0005 sleeptime=0
0006 pid=$(pidof redis-server)
0007 
0008 for x in $(seq 1 $nsamples)
0009   do
0010     gdb -ex "set pagination 0" -ex "thread apply all bt" -batch -p $pid
0011     sleep $sleeptime
0012   done | \
0013 awk '
0014   BEGIN { s = ""; } 
0015   /Thread/ { print s; s = ""; } 
0016   /^\#/ { if (s != "" ) { s = s "," $4} else { s = $4 } } 
0017   END { print s }' | \
0018 sort | uniq -c | sort -r -n -k 1,1