Methods and systems for pre-detecting a hardware hang in a processor. The
methods comprise maintaining a count of a number of cycles in a
predefined time interval without an instruction being completed;
detecting a pre-hang condition if said count is within N counts of a hang
limit; initiating trace capture in response to detecting said pre-hang
condition; and detecting a hang condition if said count equals said hang
limit.