13 lines
264 B
Bash
Executable File
13 lines
264 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ $# -lt 2 ]; then
|
|
echo './fg.sh pid times(秒)'
|
|
exit 1
|
|
fi
|
|
|
|
rm -f perf.*
|
|
perf record -F 99 -p $1 -g -- sleep $2
|
|
perf script -i perf.data &> perf.unfold
|
|
./stackcollapse-perf.pl perf.unfold &> perf.folded
|
|
./flamegraph.pl perf.folded > perf.svg
|