From 26e664ffcd510728150d56ca83e7d1c5a335b527 Mon Sep 17 00:00:00 2001 From: matugm Date: Sat, 21 Mar 2015 01:01:05 +0100 Subject: [PATCH 1/2] Add strace --- pages/linux/strace.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pages/linux/strace.md diff --git a/pages/linux/strace.md b/pages/linux/strace.md new file mode 100644 index 000000000..29fd4b8ed --- /dev/null +++ b/pages/linux/strace.md @@ -0,0 +1,16 @@ +# strace + +> Troubleshooting tool for tracing system calls + +- Start tracing a specific PID + +`strace -p {{pid}}` + +- Trace a process and filter output by system call + +`strace -e {{system call name}} -p {{pid}}` + +- Start tracing and produce a summary of system calls at the end, instead of showing individual calls. + +`strace -c -p {{pid}}` + From 9b769653331ed8cc4edc8dbc9ebe0386c3937af8 Mon Sep 17 00:00:00 2001 From: matugm Date: Sat, 21 Mar 2015 02:02:35 +0100 Subject: [PATCH 2/2] Update strace --- pages/linux/strace.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/linux/strace.md b/pages/linux/strace.md index 29fd4b8ed..7b315ad4e 100644 --- a/pages/linux/strace.md +++ b/pages/linux/strace.md @@ -2,15 +2,15 @@ > Troubleshooting tool for tracing system calls -- Start tracing a specific PID +- Start tracing a specific process by its PID `strace -p {{pid}}` - Trace a process and filter output by system call -`strace -e {{system call name}} -p {{pid}}` +`strace -p {{pid}} -e {{system call name}}` -- Start tracing and produce a summary of system calls at the end, instead of showing individual calls. +- Count time, calls, and errors for each system call and report a summary on program exit. -`strace -c -p {{pid}}` +`strace -p {{pid}} -c`