mdserver-web/plugins/dynamic-tracking/versions/debian.sh

25 lines
918 B
Bash
Raw Permalink Normal View History

2023-08-24 00:52:10 -04:00
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
2023-08-22 05:18:32 -04:00
2023-08-24 00:52:10 -04:00
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
SYS_ARCH=`arch`
# apt-get install linux-perf
# apt-get update -y
# strace -p $(ps -ef|grep "pool www" | awk '{print $2}' | grep -v grep | tr '\n' ',' )
2023-08-27 03:38:00 -04:00
# perf record -F 99 -p 2401699 -g -- sleep 30
2023-08-24 00:52:10 -04:00
# perf script > out.perf
2023-08-22 05:25:54 -04:00
# /www/server/dynamic-tracking/FlameGraph/stackcollapse-perf.pl out.perf > out.folded
2023-08-24 00:52:10 -04:00
# /www/server/dynamic-tracking/FlameGraph/flamegraph.pl out.folded > php-zend-flame-graph.svg
# WWW_PID=$(ps -ef|grep "pool www" | awk '{print $2}' | grep -v grep | tr '\n' ',')
# WWW_PID=${WWW_PID//,/}
2023-08-22 05:37:53 -04:00
# WWW_PID=${var%,}
2023-08-24 00:52:10 -04:00
# perf record -F 99 -p "1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1127,1128,1129,1130,1131,1473,1768,2848,2962,21582,35891" \
# -g -- sleep 30