ptrace for profiling?

John Meacham
Mon, 31 Mar 2003 07:38:07 -0800

this may be a totally absurd request, but would it be possible to use
ptrace or some other mechanism for poking a running program to cause a
program to start generating profiling data or change what type of
profiling data it is producing? 

I tend to view the profiling graph in real-time as I run my Haskell
program interactively. every now and again I notice my program is
behaving oddly but I am unable to reproduce the events that led to the
odd behavior. It would be nice to be able to poke the program in such a
way to cause it to start writing profiling frames to the stack for a

is this plausible?

John Meacham - California Institute of Technology, Alum. -