Patent ID: 7506314

Claim:
A method of automatically adjusting a level of trace data collection, comprising: monitoring program activity occurring during execution of a computer program; collecting trace data representative of the program activity; writing, after the collecting the trace data reaches a predetermined point, the trace data to one or more trace records in a trace history buffer located in a volatile memory, each of the one or more trace records including a trace level associated therewith, the trace level indicating a severity of the program activity, the trace history buffer being a circular buffer such that oldest trace records are overwritten by newest trace records in a cyclical manner if the trace history buffer becomes full; comparing, for each trace record stored in the trace history buffer, the trace level to a predetermined threshold value, and writing the trace record to a log file located in persistent storage as a logged trace record if the trace level is greater than the predetermined threshold value; writing each remaining trace record stored in the trace history buffer, to the log file if (i) at least one of the trace records is written to the log file as the logged trace record and (ii) a trap value specific to a process from a plurality of processes in the program activity is detected within the logged trace record; writing the trace history buffer to the log file if the trap value specific to the program activity fails to be detected, and if the trace level associated with the logged trace record is subsequently determined to be greater than a predetermined trace history level; upon writing the trace history buffer to the log file, resizing the trace history buffer if a quantity of the one or more trace records in the trace history buffer exceeds a predetermined number of trace records; and resetting and clearing the trace history buffer such that storing of trace records may continue.