I'm quite used to randomly pausing a running program in gdb to get an idea as to where it's spending it's time, as described in How can I profile C++ code running in Linux?. It seems like this technique is most appropriate for batch processes, as opposed to interactive/real-time systems.
For a program that I'm currently working on, the vast majority of samples are in epoll_wait(). That's obviously not a candidate for a speedup, but I'd like to know what the other performance bottlenecks are.
Ideally what I'd like would be a way to generate several stack traces (together with arguments and maybe the environment) from those time intervals when the thread is not blocked by epoll_wait().
Does anyone know a good method of doing this, or should I bite the bullet and switch to using a profiler?