# Patent

## Title
Method and mechanism for debugging a series of related events within a computer system

## Abstract

The present invention provides a method and mechanism for debugging a series of related events within a computer system. According to an embodiment, when tracing a series of related events that span across a plurality of threads, a token may be passed from one thread to another, thereby allowing a link between the threads to be marked within the one or more traces. The token may be passed via a messaging API, such as a network layer API or a shared resource. With this aspect of the invention, sufficient information will be provided within the one or more traces to allow all the related trace data to be linked together.

## Background
BACKGROUND AND SUMMARY
Tracing is an approach for logging the state of computer applications at different points during its course of execution. Tracing is normally implemented by inserting statements in the computer application code that outputs status/state messages (“traces”) as the statements are encountered during the execution of the code. Statements to generate traces are purposely placed in the computer application code to generate traces corresponding to activities of interest performed by specific sections of the code. The generated trace messages can be collected and stored during the execution of the application to form a trace log.
Programmers often use tracing and trace logs to diagnose problems or errors that arise during the execution of a computer application. When such a problem or error is encountered, trace logs are analyzed to correlate trace messages with the application code to determine the sequence, origin, and effects of different events in the systems and how they impact each other. This process allows analysis/diagnoses of unexpected behavior or programming errors that cause problems in the application code.
In a parallel or distributed environment, there are potentially a number of distributed network nodes, with each node running a number of distinct execution entities such as threads, tasks or processes, which may comprise of a plurality of threads. In many modem computer applications, these threads perform complex interactions with each other, even across the network to threads on other nodes. Often, each of the distributed nodes maintains a separate log file to store traces for their respective threads. Each distributed node may also maintain multiple trace logs corresponding to separate threads on that node.
Diagnosing problems using multiple trace logs often involves a manual process of repeatedly inspecting different sets of the trace logs in various orders to map the sequence and execution of events in the application code. This manual process attempts to correlate events in the system(s) with the application code to construct likely execution scenarios that identify root causes of actual or potential execution problems. Even in a modestly distributed system of a few nodes, this manual process comprises a significantly complex task, very much limited by the capacity of a human mind to comprehend and concurrently analyze many event scenarios across multiple threads on multiple nodes. Therefore, analyzing traces to diagnose applications in parallel and/or distributed systems and/or single node systems is often a time consuming and difficult exercise fraught with the potential for human limitations to render the diagnosis process unsuccessful. In many cases, the complexity of manual trace analysis causes the programmer to overlook or misdiagnose the real significance of events captured in the trace logs. With the increasing proliferation of more powerful computer systems capable of greater execution loads across more nodes, the scope of this problem can only increase.
An improved approach to diagnosing computer systems and applications uses trace messages that are materialized in a markup language syntax. Hyperlinks can be placed in the trace messages to facilitate navigation between sets of related traces. One method to generate trace messages having markup language syntax is to first generate trace strings from an application having a known set of fixed formats, in which the process for extracting information to create a new version of the trace in a markup language syntax is driven by knowledge of the position and existence of specific data in the trace strings. This type of approach is described in more detail in co-pending U.S. patent application Ser. No. 09/872,647, entitled “Method and Mechanism for Diagnosing Computer Applications Using Traces,” filed on May 31, 2001, which is hereby incorporated by reference in its entirety.
Further, traces with markup language syntax may also be generated using non-fixed format traces. In this approach, each set of traces may correspond to a defined trace format grammar, wherein the process for extracting information to create a new version of the trace in a markup language syntax is driven by the corresponding defined trace format grammar (TFG). Thus, if change to the trace format is desired, then an additional TFG may be defined instead of having to change the code of the corresponding tools to navigate through the traces. This type of approach is described in more detail in co-pending U.S. patent application Ser. No. 09/872,590, entitled “Method and Mechanism for Using a Meta-Language to Define and Analyze Traces,” filed on May 31, 2001, which is hereby incorporated by reference in its entirety.
Embodiments of the present invention provide methods and mechanisms for debugging a series of related events within a computer system. According to an embodiment, when tracing a series of related events that span across a plurality of threads, a token may be passed from one thread to another, thereby allowing a link between the threads to be marked within the one or more traces. The threads may reside on a single node and/or process or a plurality of nodes and/or processes.
With this aspect of the invention, sufficient information will be provided within the one or more traces to allow all the related trace data to be linked together. Further aspects, objects, and advantages of the invention are described below in the detailed description, drawings, and claims.



BRIEF DESCRIPTION OF THE DRAWINGS
The accompanying drawings are included to provide a further understanding of the invention and, together with the Detailed Description, serve to explain the principles of the invention.
FIG. 1 is a flowchart of a method in accordance with the present invention.
FIG. 2 is a diagram of a system architecture with which the present invention may be implemented.
FIG. 3 is a diagram of another system architecture with which the present invention may be implemented.
FIG. 4 is a diagram of a system in accordance with the present invention residing on a node.
FIGS. 5 and 6 are diagrams of system architectures with which the present invention may be implemented.



DETAILED DESCRIPTION
The present invention is disclosed in a number of different embodiments as methods and mechanisms for debugging a series of related events within a computer system. Some of the embodiments described are directed to one or more series of related events that span across multiple processes and/or multiple nodes. However, the principles presented here are applicable to any series of related events, including a series of related events within a single process and/or single node, and thus the scope of the invention is not to be limited to the exact embodiments shown herein.
Many computer applications execute one or more series of related events that span across multiple threads, processes, and/or nodes. For example, a computer application may be developed to query multiple databases residing on multiple nodes. The application may execute one or more queries that span across one or more of the multiple databases. When tracing such related events, trace data may be generated in multiple trace logs corresponding to the multiple nodes and/or processes. Manually navigating through the trace logs can be a difficult task. One method to alleviate the difficulty is to identify each state within the one or more sequence of related events where tracing is desired. Then, during execution, at each state, mark the current state and the previous state when tracing, even if the sequence of related events spans across a plurality threads, processes, and/or nodes. Turning to FIG. 1, a method of tracing a sequence of related events that span across a plurality of threads is illustrated. A series or sequence of related events may first be characterized or defined as a protocol (action block 10). The protocol definition may include an identification for the protocol and an entry point of the protocol.
After the protocol has been established (action block 10), one or more states and/or events within the protocol where tracing is desired may be identified and labeled sequentially with a number (hereinafter referred to as the “state sequence number” (SSN)) for identification (action block 20). During execution of the protocol, at each state, a trace record may be created which includes the current SSN and the previous SSN (action block 30), thus producing a “link list” of all the states, which facilitates in linking related trace data together.
If there is more than one occurrence of the protocol executing (decision block 40), then each occurrence may have a description for identification (action block 50). For example, each occurrence may be labeled sequentially with a number (hereinafter referred to as the “occurrence sequential number” (OSN)). The OSN may also be reflected in the trace record. It may be desirable to ensure that each OSN is unique. If the protocol spans across multiple nodes, then one approach to ensure uniqueness is to include the node number of the node that initiated the occurrence in the description of the OSN.
If the execution of an occurrence of the protocol moves from one thread to another (decision block 60), then it may be desirable to establish a link between the last trace record for the one thread and the first trace record for the other thread in order to continue the link list. One approach is to pass a token containing meta-data, such as the SSN of the last trace record for the one thread, from the one thread to the other thread, thereby allowing a link between the one thread and the other thread to be marked within the trace data (action block 70).
Referring to FIG. 2, an approach to passing a token is illustrated. Generally, the execution of the protocol 100 may move from one thread 1 to another thread 2 by sending an inter-process communication (IPC) message between the threads. In this illustration, the threads reside on a single node and/or process. The IPC message may contain instructions to continue the protocol 100 on the other thread 2. This typically involves using a messaging API 110 having a “send message” type function. Examples of messaging APIs 110 include network layer APIs and shared resources such as shared disks and/or shared memory. When the send message type function is invoked, the messaging API 110 will send an IPC message generated by the protocol 100 on thread 1 to thread 2 to continue the execution of the protocol 100. The messaging API will relay the IPC message to thread 2. The figure represents the messaging API 110 as two entities, but the messaging API 110 may also be a single entity.
To enable a link to be established between thread 1 and thread 2 within the trace data, the trace record for the first state of the continuation of the protocol within thread 2, State X+1, may identify the SSN of the previous state, i.e., the last state reached, State X, in thread 1 before the execution of the protocol moved from thread 1 to thread 2. This may be achieved by passing a token from thread 1 to thread 2 containing meta-data regarding the execution of the protocol on thread 1, which may include the protocol identification, the OSN and the SSN of the last trace record, and the state of the protocol. A token that may be used in the illustration in FIG. 2, for example, may include the SSN and the OSN for State X, X,1. For multiple occurrences of the protocol, as can be appreciated by one of ordinary skill in the art, it may be desirable to couple the SSN and the OSN for each trace record to ensure that the related data are properly linked together.
One method to pass the token is to place the token within the IPC message sent by the protocol on thread 1, which may require the programmer of the protocol to develop code that passes the token. A preferred method is to “piggy back” the token to the IPC message, i.e., use the messaging API to append the token to the IPC message sent by the protocol on thread 1. For example, if the messaging API is a network layer API, then the token may be placed in the header of an IPC message being sent via the network layer API. An advantage of this technique is that the burden of passing the token is removed from the coding of the protocol. Alternatively, the IPC message may be the token itself.
Referring to FIG. 3, an approach to passing a token from one thread to another is illustrated, wherein the threads reside on different nodes. The execution of the protocol 100 may move from one node 1 to another node 2 by sending an IPC message between the nodes. Enabling a link to be established between the nodes uses the same principles described above. As mentioned above, the messaging API 110 may be a network layer API and/or a shared resource such as a shared disk.
Referring back to FIG. 1, if the execution of any of the occurrences of the protocol has ended (decision block 80), then the trace data may be parsed into a more readable format (action block 90). Since the trace has sufficient information to link related trace data together, a markup language may be used to hyperlink the related trace data, as described in U.S. patent application Ser. No. 09/872,647. Additionally, a trace format grammar may be used to parse the trace data, as described in U.S. patent application Ser. No. 09/872,590. A keyword, such as PROTOCOL, may be added into each trace record, so that a parsing application may identify each record within the trace data. The first SSN may be identified using a keyword such as PROT_BEGIN to specify the beginning of the protocol. In addition, the last SSN may be identified using a keyword such as PROT_END to specify the end of the protocol. Further, the trace data may be color coded, depending upon, for example, the protocol or the occurrence of a protocol.
In addition to the current SSN and the previous SSN, each trace record may also include the OSN, node information, process information, machine name, and other applicable trace data for that state. If the execution moves from one thread to another and an IPC message was sent, the IPC message may be placed in either, or both, the trace records for the last state reached on the one thread and the first state reached on the other node.
FIG. 4 shows components of a tracing system 200 in accordance with an embodiment of the present invention. The system 200 may reside on a node 205 having a messaging API 110. The system may reside in shared memory within the node and may be configured for creating trace records, passing tokens, and receiving tokens for one or more occurrences of one or more series of related events defined as protocols 100 residing on the node 205.
In this embodiment, the developer of the protocol 100 may establish a plurality of states within the protocol 100—the system 200 may provide each state with a corresponding SSN. Each occurrence of the protocol 100 may have a corresponding OSN, as described above. The system 200 includes a trace generator 210, which creates the trace records for the one or more occurrences of the one or more protocols 100. The system 200 may further include an array of protocol identifications 220, which is a global array that includes the identifications of all the defined protocols 100 on the node 205. Each array element may include, in addition to the identification, an entry point for the protocol 100, which may be established by the developer of the protocol 100. Alternatively, the protocol identifications may be stored in a bit vector (not shown). The system 200 further includes one or more pairs of global variables, 230/240, for one or more occurrences of the one or more protocols 100 on the node 205, wherein each variable of a pair stores the current SSN 230 and the previous SSN 240 during the execution of the corresponding occurrence of the corresponding protocol 100.
At the beginning of the execution of an occurrence of the protocol 100, when the protocol 100 reaches the first state where tracing is desired, the protocol 100 may invoke a tracing function 250 of the system 200. As can be appreciated by one of ordinary skill in the art, this tracing function 250 may be similar to a “printf” function, wherein trace data is passed as an argument to the function. The trace generator 210 may, in response, refer to the array of protocol identifications 220 to determine which protocol 100 is calling the tracing function 250 and then update the corresponding current SSN 230 and previous SSN 240 variables. The initial values of the variables 230/240 point to the first SSN, which as mentioned above, may be given a special value such as PROT_BEGIN. As the subsequent states are reached and subsequent trace functions 250 are invoked, the current SSN 230 and previous SSN 240 are updated accordingly, i.e., the current SSN variable 230 will have the value of the SSN of the current state, e.g., the incremental value of the previous SSN, and the previous SSN variable 240 will have the value of the SSN of the previous state.
The trace generator 210 will further create a trace record corresponding to the current state, which may include the identification of the protocol 100, the OSN if applicable, i.e., if there is more than one occurrence of the protocol 100 in execution, the current SSN, the previous SSN, and any other applicable trace data, such as the trace data passed by the protocol in the tracing function call 250.
If the protocol 100 is configured to continue execution on another thread, then the system 200 may be configured to monitor the messaging API 110 to determine whether the protocol 100 sends an IPC message to another thread, or whether the protocol 100 receives an IPC message from another thread. This monitoring may be in the form of receiving notifications 255 from the messaging API 110 indicating whether an IPC message has been sent by the protocol 100 or received from an earlier sequence of a protocol 100 residing on another thread.
If an IPC message has been sent by the protocol 100 to a continuation of the protocol 100 on another thread, then the system 200 may pass a token 260 along with the IPC message sent. As described above, this may be achieved by appending the token to the IPC message, placing the token in the IPC message, or sending the token as an IPC message. The token may include meta-data such as the protocol identification, the OSN and the SSN of the last trace record, and the state of the protocol, which may be included as a trace record within the trace data.
Further, if an IPC message has been received by the messaging API 110, the system 200 may be notified 255 and retrieve the token 270 from the IPC message. The system 200 may then use the array of protocol identifications 220 to identify the protocol 100 that sent the IPC message and then either search for or create the corresponding current and previous SSN variables 230/240, which may be updated from the information provided by the token. The messaging API 110 then forwards the IPC message to the protocol 100 to continue execution. The meta-data within the token may be included as a trace record within the trace data.
When the execution of an occurrence of a protocol 100 has ended, the last SSN may be labeled with a special value, such as PROT_END. Subsequently, the trace data, which may reside in one or more trace logs, may be parsed and may further be converted into a markup language syntax as described in U.S. patent application Ser. No. 09/872,647. Further, as mentioned above, the trace records may be created in accordance with a trace format grammar and parsed using the systems and methods described in U.S. patent application Ser. No. 09/872,590.
The system 200 will produce trace data with information that enables all the related trace data to be linked together automatically, even if the trace data resides on multiple trace logs. The related trace data linked together, in conjunction with the trace format grammar and mechanisms described in U.S. patent application Ser. No. 09/872,590 and the markup language syntax described in U.S. patent application Ser. No. 09/872,647, facilitate in navigating through several occurrences of a number of protocols automatically, thus reducing the complexity of analysis.
SYSTEM ARCHITECTURE OVERVIEW
Referring to FIG. 5, in an embodiment, a computer system 520 includes a host computer 522 connected to a plurality of individual user stations 524. In an embodiment, the user stations 524 each comprise suitable data terminals, for example, but not limited to, e.g., personal computers, portable laptop computers, or personal data assistants (“PDAs”), which can store and independently run one or more applications, i.e., programs. For purposes of illustration, some of the user stations 524 are connected to the host computer 522 via a local area network (“LAN”) 526. Other user stations 524 are remotely connected to the host computer 522 via a public switched telephone network (“PSTN”) 528 and/or a wireless network 530.
In an embodiment, the host computer 522 operates in conjunction with a data storage system 531, wherein the data storage system 531 contains a database 532 that is readily accessible by the host computer 522. Note that a multiple tier architecture can be employed to connect user stations 524 to a database 532, utilizing for example, a middle application tier (not shown). In alternative embodiments, the database 532 may be resident on the host computer, stored, e.g., in the host computer's ROM, PROM, EPROM, or any other memory chip, and/or its hard disk. In yet alternative embodiments, the database 532 may be read by the host computer 522 from one or more floppy disks, flexible disks, magnetic tapes, any other magnetic medium, CD-ROMs, any other optical medium, punchcards, papertape, or any other physical medium with patterns of holes, or any other medium from which a computer can read. In an alternative embodiment, the host computer 522 can access two or more databases 532, stored in a variety of mediums, as previously discussed.
Referring to FIG. 6, in an embodiment, each user station 524 and the host computer 522, each referred to generally as a processing unit, embodies a general architecture 605. A processing unit includes a bus 606 or other communication mechanism for communicating instructions, messages and data, collectively, information, and one or more processors 607 coupled with the bus 606 for processing information. A processing unit also includes a main memory 608, such as a random access memory (RAM) or other dynamic storage device, coupled to the bus 606 for storing dynamic data and instructions to be executed by the processor(s) 607. The main memory 608 also may be used for storing temporary data, i.e., variables, or other intermediate information during execution of instructions by the processor(s) 607. A processing unit may further include a read only memory (ROM) 609 or other static storage device coupled to the bus 606 for storing static data and instructions for the processor(s) 607. A storage device 610, such as a magnetic disk or optical disk, may also be provided and coupled to the bus 606 for storing data and instructions for the processor(s) 607.
A processing unit may be coupled via the bus 606 to a display device 611, such as, but not limited to, a cathode ray tube (CRT), for displaying information to a user. An input device 612, including alphanumeric and other columns, is coupled to the bus 606 for communicating information and command selections to the processor(s) 607. Another type of user input device may include a cursor control 613, such as, but not limited to, a mouse, a trackball, a fingerpad, or cursor direction columns, for communicating direction information and command selections to the processor(s) 607 and for controlling cursor movement on the display 611.
According to one embodiment of the invention, the individual processing units perform specific operations by their respective processor(s) 607 executing one or more sequences of one or more instructions contained in the main memory 608. Such instructions may be read into the main memory 608 from another computer-usable medium, such as the ROM 609 or the storage device 610. Execution of the sequences of instructions contained in the main memory 608 causes the processor(s) 607 to perform the processes described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions to implement the invention. Thus, embodiments, of the invention are not limited to any specific combination of hardware circuitry and/or software.
The term “computer-usable medium,” as used herein, refers to any medium that provides information or is usable by the processor(s) 607. Such a medium may take many forms, including, but not limited to, non-volatile and volatile media. Non-volatile media, i.e., media that can retain information in the absence of power, includes the ROM 409. Volatile media, i.e., media that can not retain information in the absence of power, includes the main memory 608.
Common forms of computer-usable media include, for example: a floppy disk, flexible disk, hard disk, magnetic tape, any other magnetic medium, CD-ROM, any other optical medium, punchcards, papertape, any other physical medium with patterns of holes, RAM, ROM, PROM (i.e., programmable read only memory), EPROM (i.e., erasable programmable read only memory), including FLASH-EPROM, any other memory chip or cartridge, carrier waves, or any other medium from which a processor 607 can retrieve information. Various forms of computer-usable media may be involved in providing one or more sequences of one or more instructions to the processor(s) 607 for execution. The instructions received by the main memory 608 may optionally be stored on the storage device 610, either before or after their execution by the processor(s) 607.
Each processing unit may also include a communication interface 614 coupled to the bus 606. The communication interface 614 provides two-way communication between the respective user stations 624 and the host computer 622. The communication interface 614 of a respective processing unit transmits and receives electrical, electromagnetic or optical signals that include data streams representing various types of information, including instructions, messages and data. A communication link 615 links a respective user station 624 and a host computer 622. The communication link 615 may be a LAN 526, in which case the communication interface 614 may be a LAN card. Alternatively, the communication link 615 may be a PSTN 528, in which case the communication interface 614 may be an integrated services digital network (ISDN) card or a modem. Also, as a further alternative, the communication link 615 may be a wireless network 530. A processing unit may transmit and receive messages, data, and instructions, including program, i.e., application, code, through its respective communication link 615 and communication interface 614. Received program code may be executed by the respective processor(s) 607 as it is received, and/or stored in the storage device 610, or other associated non-volatile media, for later execution. In this manner, a processing unit may receive messages, data and/or program code in the form of a carrier wave.
In the foregoing specification, the invention has been described with reference to specific embodiments thereof. It will, however, be evident that various modifications and changes may be made thereto without departing from the broader spirit and scope of the invention. For example, the reader is to understand that the specific ordering and combination of process actions shown in the process flow diagrams described herein is merely illustrative, and the invention can be performed using different or additional process actions, or a different combination or ordering of process actions. The specification and drawings are, accordingly, to be regarded in an illustrative rather than restrictive sense.

## Claims

1. A method for tracing one or more occurrences of one or more series of related events, comprising:
establishing a protocol that defines a series of related events, in which the protocol comprises an entry point for execution of the protocol;
identifying one or more states at one or more different points during execution within the protocol where tracing is desired, in which the protocol invokes one or more tracing functions at the one or more states identified;
during execution of one or more occurrences of the protocol, at each of the one or more states, determining one or more actions based upon the one or more states the protocol is currently at and marking a current state and a previous state within one or more trace records based at least in part upon an information of an occurrence of the execution of the protocol; and
during execution of the one or more occurrences of the protocol, if the execution of the one or more occurrences of the protocol moves from one thread to a second thread, then passing one or more tokens from the one thread to the second thread to allow one or more links between the one thread and the second thread to be marked within one or more traces.

2. The method of claim 1, wherein the one thread and the second thread reside on different nodes.

3. The method of claim 1, further comprising parsing the one or more trace records.

4. The method of claim 3, wherein the parsing of the one or more trace records are executed after the execution of any of the one or more occurrences of the protocol has ended.

5. The method of claim 3, further comprising generating a Previously Presented version of the one or more traces using a markup language syntax.

6. The method of claim 1, in which the one or more trace records are compliant with a trace grammar that complies with rules of a meta-language grammar.

7. The method of claim 1, further comprising: labeling each state and or each event with a current and a previous sequence numbers.

8. The method of claim 1, further comprising:
labeling each of the one or more occurrences of the protocol with the information of an occurrence of the execution of the protocol which comprises a sequence number.

9. The method of claim 1, wherein the one or more tokens are passed via a messaging API.

10. The method of claim 9, wherein the messaging API is a shared resource.

11. The method of claim 10, wherein the shared resource is a shared disk.

12. The method of claim 10, wherein the shared resource is a shared memory.

13. The method of claim 9, wherein the messaging API is a network layer API.

14. The method of claim 1, wherein the one or more tokens comprise meta-data.

15. The method of claim 1, in which the one or more actions comprise invoking a tracing function.

16. The method of claim 1, in which the one or more actions comprise ending a tracing function.

17. The method of claim 1, in which the one or more actions comprise adjusting detail level of the one or more traces.

18. The method of claim 1, in which the thread comprises a node or a process.

19. A system residing on a node having a messaging API for tracing an execution of one or more related events comprising:
means for establishing a protocol that defines a series of related events, in which the protocol comprises an entry point for execution of the protocol;
means for identifying one or more states at one or more different points during execution within the protocol where tracing is desired, in which the protocol invokes one or more tracing functions at the one or more states identified;
during execution of one or more occurrences of the protocol, at each of the one or more states, a processor means for determining one or more actions based upon the one or more states the protocol is currently at and means for marking a current state and a previous state within one or more trace records based at least in part upon an information of an occurrence of the execution of the protocol; and
means for passing one or more tokens from one thread to a second thread if the one or more occurrences of the protocol move from the one thread to the second thread to allow one or more links between the one thread and the second thread to be marked within one or more traces.

20. The system of claim 19, further comprising an array of protocol identifications, which stores the identifications of the protocol.

21. The system of claim 19, further comprising a bit vector of protocol identifications which stores the identifications of the protocol.

22. The system of claim 19, wherein the system is configured for sending and receiving the one or more tokens via the messaging API.

23. The system of claim 19, wherein the messaging API is a network layer.

24. The system of claim 19, wherein the messaging API is a shared resource.

25. The system of claim 19, wherein the one or more tokens comprise meta-data.

26. The system of claim 19, further comprising one or more pairs of global variables for the one or more occurrences of the protocol, wherein the first of the pair stores a current state and the second of the pair stores a previous state for the one or more occurrences of the protocol.

27. The system of claim 19, further comprising a mechanism for parsing the trace records generated by a trace generator.

28. A computer program product that includes a medium usable by a general purpose computer storing a sequence of instructions which, when executed by a processor, causes said processor to execute a process for tracing one or more occurrences of one or more series of related events, said process comprising:
establishing a protocol that defines a series of related events, in which the protocol comprises an entry point for execution of the protocol;
identifying one or more states at one or more different points during execution within the protocol where tracing is desired, in which the protocol invokes one or more tracing functions at the one or more states identified;
during execution of one or more occurrences of the protocol, at each of the one or more states, determining one or more actions based upon the one or more states the protocol is currently at and marking a current state and a previous state within one or more trace records based at least in part upon an information of an occurrence of the execution of the protocol; and
during execution of the one or more occurrences of the protocol, if the execution of the one or more occurrences of the protocol moves from one thread to a second thread, then passing one or more tokens from the one thread to the second thread to allow one or more links between the one thread and the second thread to be marked within one or more traces.

29. The computer program product of claim 28, further comprising parsing the one or more traces.

30. The computer program product of claim 29, wherein the parsing of the one or more traces is executed after the execution of any of the one or more occurrences of the protocol has ended.

31. The computer program product of claim 30, further comprising generating a Previously Presented version of the one or more traces using a markup language syntax.

32. The computer program product of claim 28, wherein the one or more traces are compliant with a trace grammar that complies with rules of a meta-language grammar.

33. The computer program product of claim 28, further comprising: labeling each state with a sequence number.

34. The computer program product of claim 28, further comprising: labeling each of the one or more occurrences of the protocol with a sequence number.

35. The computer program product of claim 28, wherein the one or more tokens are passed via a messaging API.

36. The computer program product of claim 35, wherein the messaging API is a network layer API or a shared resource.

37. The computer program product of claim 36, wherein the shared resource is a shared disk or a shared memory.

38. The computer program product of claim 28, wherein the one or more tokens comprise meta-data.