-
Notifications
You must be signed in to change notification settings - Fork 308
Expand file tree
/
Copy pathperf-script.sh
More file actions
41 lines (35 loc) · 950 Bytes
/
perf-script.sh
File metadata and controls
41 lines (35 loc) · 950 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
set -eoux pipefail
if [[ "$1" == "system-wide" ]]; then
perf record -a -F 999 -g ./simple-terminates > perf.data
perf script -i perf.data
exit 0
fi
if [[ "$1" == "forks" ]]; then
perf record -a -F 999 -g ./forks > perf.data
perf script -i perf.data
exit 0
fi
if [[ "$1" == "idle" ]]; then
perf record -a -F 999 -g ./idle > perf.data
echo "Done recording"
ls -alh perf.data
perf script -i perf.data
exit 0
fi
perf record -F 999 -g ./simple-terminates > perf.data
if [[ "$1" == "with-header" ]]; then
perf script --header -i perf.data
elif [[ "$1" == "with-pid" ]]; then
# perf script -F comm,pid,tid,time,event,ip,sym,dso -i perf.data
# comm: command (maybe truncated)
# pid: process ID
# id: thread ID
# time: time of event
# ip: instruction pointer
# sym: symbol
# dso: dynamic shared object
perf script -F comm,pid,tid,time,event,ip,sym,dso -i perf.data
else
perf script -i perf.data
fi