Skip to content

Instantly share code, notes, and snippets.

@jvns
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvns/6225c3602e0d4fa252b5 to your computer and use it in GitHub Desktop.
Save jvns/6225c3602e0d4fa252b5 to your computer and use it in GitHub Desktop.

Title: Systems programming as a swiss army knife

Duration: 30 minutes

Description:

You might think of the Linux kernel as something that only kernel developers need to know about. Not so! It turns out that understanding some basics about kernels and systems programming makes you a better developer, and you can use this knowledge when debugging your normal everyday Python programs.

We’ll talk about how to use strace, ltrace, /proc, and friends to debug your servers and your misbehaving programs. A few specific tricks we’ll cover:

  • how to recover files with /proc (and other tricks)
  • using strace to understand programs without reading their source code
  • easily hunting down which log file a program is writing to and what commands it’s executing

You’ll come away with a new toolset for debugging your programs that work in any programming language. This talk will be focused on Linux tools, with some references to their OS X counterparts.

Audience: Linux or OS X users

Python level: Novice

Objectives:

When you leave this talk, you'll have a new way to debug programs, using tools that are already on your system.

Detailed Abstract:

Outline:

The talk will break up roughly like this:

  • Hi! I'm Julia!
  • Introduce philosophy: debug programs by looking at their behavior, not by looking at the source code
  • Explain how this is even possible (what's a system call?)
  • Demo of using strace to debug programs
  • Explain /proc
  • Explain lsof
  • Other related tools (perf, tcpdump, etc.)
  • Wrap up: debug Python programs by understanding your operating system better

Additional notes:

I gave a 10 minute version of this talk at !!Con in May 2014 and it was very well received. You can see it here: Spying on your programs with strace

I spoke at PyCon last year: Diving into Open Data with IPython Notebook and pandas.

I also help organize PyLadies Montréal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment