November 8th & 9th, 2024
Love SeaGL and want to help out? Get Involved

Exploring System Calls with Strace

SeaGL 2016

You can learn a lot about what programs are doing under the hood by examining the system calls that they make. In this talk I’ll demonstrate how you can use the strace program in GNU/Linux to learn things about what programs are doing. What files are opened, read from and written to? What DNS and MySQL queries are being made? All of these questions can be answered using strace. I’ll also show how you can use strace to output timing deltas to identify slow system calls that may be hurting your program’s performance. I’ll demonstrate how you can attach strace to a running apache or nginx worker process to debug a live website. I’ll also spend a bit of time talking about GNU/Linux system calls themselves, and how strace displays the various C data structures (like sockaddr) that are used in interesting system calls like connect(2).

Some of this talk will be a bit of a rehash of my YouTube video on the subject, but this will be a longer, more in-depth dive into the world of GNU/Linux system calls and strace.

Presenters

Mike Hamrick

Mike Hamrick

I’ve been a fan and user of GNU/Linux since the mid 90s. In my professional career I’ve been a programmer, systems administrator, and DBA. I really enjoy finding bugs and solving performance problems using a variety of debugging tools and techniques. I also enjoy programming in C, Python, Go, Perl, and Elisp.

Resources