Tracing Tools Michal Seklet´ar
[email protected] March 21, 2019 whoami Senior Software Engineer RHEL systemd maintainer SW engineer interested in tracing and debugging Michal Seklet´ar
[email protected] Tracing Tools March 21, 2019 2 / 38 Motivation Have you ever wanted to answer questions like, What files in /etc are being accessed on the system ? How big are memory allocations done by [DAEMON] (insert you favorite) ? What process is a source of slow filesystem operations (e.g. slower than 50 ms) ? Michal Seklet´ar
[email protected] Tracing Tools March 21, 2019 3 / 38 Agenda PART I { Introduction Tracing vs. Debugging Goals Methodology PART II { Tools strace and ltrace (ptrace) trace-cmd (ftrace) SystemTap (kprobes) bcc-tools (eBPF) PART III { Exercises Michal Seklet´ar
[email protected] Tracing Tools March 21, 2019 4 / 38 PART I { Introduction Michal Seklet´ar
[email protected] Tracing Tools March 21, 2019 5 / 38 Intro { Debugging vs. Tracing Debugging The process of identifying and removing errors from computer software. Approaches Staring into the code Debug logging Debuggers gdb lldb Michal Seklet´ar
[email protected] Tracing Tools March 21, 2019 6 / 38 Intro { Debugging vs. Tracing Tracing Non-intrusive observation and monitoring of a software system. Approaches Syscall monitoring Gathering execution traces Stack sampling Debug logging Michal Seklet´ar
[email protected] Tracing Tools March 21, 2019 7 / 38 Intro { Goals Goals Better understanding of the system behavior Tracing should be as non-intrusive as possible In-kernel summarization (if possible) and statistical data gathering Michal Seklet´ar
[email protected] Tracing Tools March 21, 2019 8 / 38 Intro { Methodology Right tool for the job What tracing tools should I use? Unfortunately, answer to this question on Linux is not straight forward.