#
# stap ngx_php.stp -x `cat /usr/local/nginx/logs/nginx.pid` -o output.txt
#or
# stap ngx_php.stp -x `cat /usr/local/nginx/logs/nginx.pid` >> output.txt
global first
probe begin {
printf("begin nginx \n")
}
probe process("/usr/local/nginx/sbin/nginx").function("*").call {
if (target() == pid()) {
if( first == 0) {
first = 1
#print_ubacktrace()
printf("%s -> %s\n", thread_indent(16), ppfunc())
} else {
printf("%s -> %s\n", thread_indent(2), ppfunc())
}
}
}
probe process("/usr/local/nginx/sbin/nginx").function("*").return {
if (target() == pid()) {
printf("%s <- %s\n", thread_indent(-2), ppfunc())
}
}
probe end {
printf("end nginx \n")
}