Ask HN: How to programmatically observe program execution?
I'm currently researching this interesting question and haven't found much material on it: How can one best programmatically observe the execution of a program, much like single-stepping it in the debugger, but wholesale and automatically?
Rigging up a debugger was my first idea, as they do the same thing for human consumption, but that doesn't seem to be a normal use scenario, and hence no APIs. Alternatively one could extend some virtualization software to capture what the processor is doing. I would settle for source modification, which would work for just capturing function calls, but that brings in other complications. Finally there's the issue of languages: I was thinking of simple C programs, although it would probably be easier in Java or Lisp, but I'd like to stay general.
Have you ever solved this or what approach would you try?
7 comments
[ 2.6 ms ] story [ 27.2 ms ] threadMy application is to visualise the execution of programs, for which I want to ideally capture everything the processor does and generalise what I see...
http://www.pintool.org/
That's about 10 years old, though, and I don't know what's been done since.