A process and system for profiling code executing on a data processing
system is provided. Event-based trace data is recorded in response to
selected events, and the event-based trace data includes an indication of
which code is being interrupted. The trace data may be processed to
identify a thread or method that was executing during the event. A
periodically occurring event is also detected, and a stack associated with
the profiled code is identified in response to detection of the
periodically occurring event, such as a timer interrupt. The stack is
examined to identify each routine that is currently executing during the
periodically occurring event.