Linux Process Sampling

Frank Sorenson frank at
Mon Aug 23 20:45:23 MDT 2010

  On 08/23/2010 02:19 PM, Dave Smith wrote:
> On 08/22/2010 08:58 PM, Frank Sorenson wrote:
>> Why would we have to depend on DTrace? I can think of several ways to
>> do this without DTrace.  And why would we want DTrace, when we've got
>> SystemTap?
> Finally a useful response! Thanks Frank. :)
> On Ubuntu 10.04, I tried running the callgraph tracing example here:
> But all I could produce were syntax errors.

Pshaw...  Syntax errors are easy.  My kids can produce those.

My suspicion is that you may not have the needed kernel debuginfo 
components and devel headers.  It looks like in Ubuntu, this might be 
the linux-headers-generic and linux-image-debug-generic packages 

Beyond that, I've found it helps to be running a recent version of 
systemtap and of the kernel (then again, I usually run a bleeding-edge 
kernel anyway).

Have you tried the "Hello World" systemtap and some of the simpler ones 
to start off?  Good way to know whether it's working right to begin with.

>> First, there's "gstack" (aka pstack),
> I couldn't find a way to get gstack on Ubuntu 10.04. It's not part of 
> Ubuntu's gdb package apparently. Sounds promising, though. Any idea 
> where I can get it?
Taking a closer look, it's a wrapper around running gdb.  Not sure 
exactly what it's doing that's running so much faster than yours, but 
the gist of the script is "gdb --quiet --readnever -nx /proc/$pid/exe 
$pid", run "thread apply all bt", and process the output to make it 
cleaner.  If you're unable to find it in a package or the source, let me 
know, and I'll send you a copy.

>> Then, there's "fstack", which is a part of frysk.
> I'll have to look into this one as well, though it does not appear to 
> be packaged in Ubuntu at the moment. I'll see if I can get source and 
> install manually.

Probably start here -


Frank Sorenson - KD7TZK
Linux Systems Engineer, DSS Engineering, UBS AG
frank at

More information about the PLUG mailing list