-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstrace
31 lines (22 loc) · 784 Bytes
/
strace
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
# Basic stracing
strace <command>
# save the trace to a file
strace -o strace.out <other switches> <command>
# follow only the open() system call
strace -e trace=open <command>
# follow all the system calls which open a file
strace -e trace=file <command>
# follow all the system calls associated with process
# management
strace -e trace=process <command>
# follow child processes as they are forked
strace -f <command>
# follow child processes as they are vforked
strace -F <command>
# count time, calls and errors for each system call
strace -c <command>
# trace a running process (multiple PIDs can be specified)
strace -p <pid>
# -ff 配合 -o filename,则所有进程的跟踪结果输出到相应的 filename.<pid> 中
strace -ff -f -o log -p <pid>
# vim: set ft=sh