June 19, 2014

Perf and Stack Traces

I was wondering why perf record -g don’t show proper stack traces for my programs in production environment. First I thought that kernel was too old, but after performing few experiments I have found out that it wasn’t the case. Problem was that when you compile with optimizations (-O3), gcc automatically omits frame pointers. And it is not easy to unwind stack traces without frame pointers. But gcc can do it somehow. Read more

May 2, 2014

Perf on Latest Linux Kernel

I have being playing today with perf on latest available kernel in Fedora (3.13). These are just some observations and thoughts. perf trace This tool is similar to strace, but almost without overhead. Contrary to strace, you can use perf trace to watch syscalls system wide or system calls generated by processes owned by certain user. perf top Function names are shown correctly and -g parameter is now available. It means that you can get call traces in a real time (without perf record). Read more