An event tracing program generally receives performance data about an event occurring on the computer system from a data producer program. The event tracing program responds by recording the event performance data in one of a set of a log buffers. When a log buffer becomes full, the event tracing program places the log buffer on a buffer flush list. The filled buffer is then written out to a more permanent storage medium, such as a disk. From time to time, the event tracing program may also transfer a buffer to the flush list prior to becoming full after a time-out period. To prevent a buffer from being flushed while event performance data is being recorded in the buffer, a reference count is incremented prior to the record operation to signify that the buffer is currently being modified. For high performance on multiprocessor systems, the buffers are allocated per processor to minimize data sharing among processors.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method of tracing an event on a computer system comprising the steps of: reserving a log buffer; changing a reference variable in the log buffer from a first value to a second value; recording data descriptive of the event in the log buffer; and changing the reference variable from the second value to the first value to indicate that the recording step is complete, wherein the reference variable is usable to determine whether the log buffer may be flushed.
2. The method according to claim 1 , the computer system having a memory and a plurality of processors, further comprising the steps of: receiving data descriptive of an event from a program running on one of the processors; and associating the log buffer with the processor.
3. The method according to claim 1 , further comprising the steps of: determining whether the log buffer is full; determining whether the reference variable is equal to a baseline value; and if the log buffer is full and the reference variable is equal to the baseline value, flushing the log buffer.
4. The method according to claim 3 , further comprising the steps of: moving the log buffer from a flush list to a free buffer list using an interlock exchange.
5. The method according to claim 1 , further comprising the steps of: determining whether the log buffer is full; and if the log buffer is full, adding the log buffer to a flush list.
6. The method according to claim 1 , further comprising the steps of: examining an offset variable in the log buffer to determine the starting location to be used for the recording step; and incrementing the offset variable.
7. The method according to claim 6 , further comprising the step of storing the reference variable and the offset variable in the same data structure.
8. The method according to claim 6 , further comprising the step of cache aligning the reference variable and the offset variable.
9. The method according to claim 6 , wherein the computer system has a memory, the processor has a register, further comprising the step of aligning the reference and offset variables in the memory according to the size of the register.
10. The method according to claim 1 , further comprising the step of cache aligning the descriptive data.
11. The method according to claim 1 , wherein the computer system has a memory, the processor has a register, further comprising the step of aligning the descriptive data in the memory according to the size of the register.
12. The method according to claim 1 , the computer system having a memory, a plurality of processors, the processors having associated log buffers, further comprising the steps of: determining whether a free buffer list is empty; determining the amount of the memory being occupied by the associated log buffers; and if the free buffer list is empty and the amount of memory being occupied by the associated log buffers is less than a predetermined maximum, designating an additional block of the memory to be a log buffer.
13. The method according to claim 1 , the computer system having a memory and a plurality of processors, further comprising the steps of: receiving data descriptive of an event from a program running on one of the processors; and associating the log buffer with an ideal processor, wherein the ideal processor provides a hint as to the processor on which the program is running.
14. A computer-readable medium having computer-executable instructions for performing steps comprising: reserving a log buffer; changing a reference variable in the log buffer from a first value to a second value;recording data descriptive of the event in the log buffer; and decreasing the value in the reference variable by one to indicate that the recording step is complete, wherein the reference variable is usable to determine whether the log buffer may be flushed.
15. The computer-readable medium of claim 14 , having further computer-executable instructions for performing steps comprising: receiving data descriptive of an event from a program running on one of a plurality of processors; and associating the log buffer with the processor.
16. The computer-readable medium of claim 14 having further computer-executable instructions for performing steps comprising: determining whether the log buffer is full; determining whether the reference variable equals a baseline value; and if the log buffer is full and the reference variable equals the baseline value, flushing the log buffer.
17. The computer-readable medium of claim 16 having further computer-executable instructions for performing steps comprising: moving the log buffer from a flush list to a free list using an interlock exchange.
18. The computer-readable medium of claim 14 having further computer-executable instructions for performing steps comprising: determining whether the log buffer is full; if the log buffer is full, adding the log buffer to a flush list.
19. The computer-readable medium of claim 14 having further computer-executable instructions for performing steps comprising: examining an offset variable in the buffer to determine the starting location to be used for the recording step; and incrementing the offset variable.
20. The computer-readable medium of claim 19 , wherein the reference variable and the offset variable are stored in the same data structure.
21. The computer-readable medium of claim 19 , wherein the reference variable and the offset variable are cache aligned.
22. The computer-readable medium of claim 19 , having further computer-executable instructions for performing step of aligning the reference and offset variables in a memory according to the size of a processor register.
23. The computer-readable medium of claim 14 , wherein the descriptive data is cache aligned.
24. The computer-readable medium of claim 14 having further computer-executable instructions for performing step of aligning the descriptive data in a memory according to the size of a processor register.
25. The computer-readable medium of claim 14 having further computer-executable instructions for performing steps comprising: determining whether a free buffer list is empty; determining the amount of a memory being occupied by log buffers associated with a plurality of processors; and if the free buffer list is empty and the amount of memory being occupied by the associated log buffers is less than a predetermined maximum, designating an additional block of the memory to be a log buffer.
26. The computer-readable medium of claim 14 having further computer-executable instructions for performing steps comprising: receiving data descriptive of an event from a program running on one of a plurality of processors; and associating the log buffer with an ideal processor, wherein the ideal processor provides a hint as to the processor on which the program is running.
27. A computer-readable medium having stored thereon a data structure, comprising: a log buffer for recording the occurrence of an event on a computer system; and a reference count variable located within in the log buffer, wherein the reference count variable has a base value and wherein a difference between the value of the reference count variable and the base value indicates whether the log buffer is being updated by one or more programs.
28. The computer-readable medium of claim 27 , wherein the data structure further comprises: a first list containing references to a set of free log buffers; and a second list containing references to a set of full log buffers; wherein when one of the set of full log buffers is flushed, its associated reference is transferred to the first list.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
July 16, 1999
December 10, 2002
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.