From d7bc5507ba57f07109a7ba73e1d08d2c69817204 Mon Sep 17 00:00:00 2001 From: Amit Saha Date: Wed, 27 Nov 2013 11:47:40 +1000 Subject: [PATCH] Add cheatsheet for strace --- cheatsheets/strace | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 cheatsheets/strace diff --git a/cheatsheets/strace b/cheatsheets/strace new file mode 100644 index 0000000..8ae4b41 --- /dev/null +++ b/cheatsheets/strace @@ -0,0 +1,24 @@ +# Basic stracing +strace + +# save the trace to a file +strace -o strace.out + +# follow only the open() system call +strace -e trace=open + +# follow all the system calls which open a file +strace -e trace=file + +# follow all the system calls associated with process +# management +strace -e trace=process + +# follow child processes as they are created +strace -f + +# count time, calls and errors for each system call +strace -c + +# trace a running process (multiple PIDs can be specified) +strace -p \ No newline at end of file