stap -ve ‘probe begin { log("hello systemtap!") exit() }‘ 如果提示pass 5: run completed ... 就表示安装成功。#!/bin/sh
if [ $# -ne 3 ]
then
echo "Usage: ./`basename $0` lua/c PID NAME"
exit
fi
pid=$2
name=$3
if [ $1 == "lua" ]
then
/opt/nginx-systemtap-toolkit/ngx-sample-lua-bt -p $pid --luajit20 -t 30 >temp.bt
/opt/nginx-systemtap-toolkit/fix-lua-bt temp.bt >${name}.bt
elif [ $1 == "c" ]
then
/opt/nginx-systemtap-toolkit/sample-bt -p $pid -t 10 -u > ${name}.bt
else
echo "type is only lua/c"
exit
fi
/opt/FlameGraph/stackcollapse-stap.pl ${name}.bt >${name}.cbt
/opt/FlameGraph/flamegraph.pl ${name}.cbt >${name}.svg
rm -f temp.bt ${name}.bt ${name}.cbt

原文:http://www.cnblogs.com/sxhlinux/p/6250619.html