Most operating systems have means to kill/terminate a task. Killing a task can become necessary when a task is stalled and occupies resources like memory and CPU. The way how task termination is implemented differs between operating systems, but it is an ungrateful way of ending and should only be used when there is no alternative because cleanup of resources is not done, e.g. stack, mutexes, synchronization objects are not released.
Considering this behaviour from a profiler's perspective it's a disaster. A profiler watches function entry and exit points by tracking the stack. As long as the stack is valid, the task is regarded alive, but maybe in suspended state to be resumed in the future. If now the task is terminated without cleaning the stack, the profiler needs to know about it to avoid incorrect measurements.
winIDEA's profiler can now be configured to be aware of these so called stack killers. When execution in the stack killer is detected, all active functions in the task within the current context (whose exit has not been detected jet) are considered preemptively terminated and all stack entries downto it's previous invocation are dismissed.
The stack killer configuration window is shown in Profiler's Configuration when pressing the "Advanced..." button.
Comments