What Is That Process Doing?*
We're surrounded by programs we didn't write. Inevitably they eventually do the wrong thing, or they just don't do what we need, and we want to find out what they are doing. Learn how to spy on the processes you run.
We’ll see how to:
- See what a process that’s stuck is stuck doing.
- See where a process that can’t find its config file is looking for it.
- See how a process is invoking some other program.
- See where a process is writing its logs to.
- See what libraries a process is actually using — including C extension modules for a program written in Python, Ruby, or the like.
- Identify where a slow process is spending its time.
- See inside a process, and even examine Python, Ruby, etc., programs in their own languages’ terms.
In fact, with
strace we can spy on everything a process does that interacts with the filesystem, the network, other processes, or anything else outside its own borders — even the clock. With
perf we can count clock cycles as we follow the CPU all around the program’s logic and even into the kernel. With
gdb we can study everything in memory and run any code. We’ll see how to use these tools and others.
I've spoken at ConFoo 2013 (in Montreal), at Ruby user groups on both coasts, at several academic conferences when I was a graduate student, and at a number of smaller occasions.
Video of my talk at BostonRB is online: http://bostonrb.org/presentations/profiling-ruby
Slides are in the video, or at https://speakerdeck.com/gnprice/profiling-ruby
For other talks, see slides:
on Haskell, at MIT (http://cluedumps.mit.edu/wiki/2007/11-19)
on a virtualization system I'd coauthored, at MIT (http://cluedumps.mit.edu/wiki/2008/12-09)
on Cython and PyPy, at ConFoo (https://speakerdeck.com/gnprice/accelerating-your-python-application-cython-and-pypy)
I haven't yet given this talk anywhere else.
Greg Price is a software engineer bringing fast, automated continuous integration to everyone with Solano Labs. Previously he worked at Quora, and helped Ksplice make rebooting obsolete.
Greg once thought a career making theorems instead of code would be fun, but after two years of a few good theorems and much more code snuck into off-hours, he decided to run with it. He loves Python in practice, Haskell in principle, and creating code that communicates its meaning clearly to both computers and people and solves the right problem well.
- Title: What Is That Process Doing?
- Track: Chemistry
- Room: B302/303
- Time: 11:00 – 11:45am
We’re surrounded by programs we didn’t write. Inevitably they eventually do the wrong thing, or they just don’t do what we need, and we want to find out what they are doing. Learn how to spy on the processes you run.
- Speakers: Greg Price