Studio:Scl tracepoint: Difference between revisions
Jump to navigation
Jump to search
(→Notes) |
|||
Line 27: | Line 27: | ||
* There are no constraints on different application threads using the same trace point. | * There are no constraints on different application threads using the same trace point. | ||
* Trace points can use payloads to represent debug information that is being provided to the host Runtime environment. | * Trace points can use payloads to represent debug information that is being provided to the host Runtime environment. | ||
* The only constraint unique to trace point payloads versus message payloads is that there is no support for | * The only constraint unique to trace point payloads versus message payloads is that there is no support for pointers within the payloads. The memory block pointed to is not transferred over to the host Runtime environment. | ||
== Examples == | == Examples == |
Revision as of 22:22, 9 October 2008
The scl_tracepoint pragma
The scl_tracepoint pragma allows you to define a trace point by associating a STRIDE Trace Point Identifier (STPID) with a payload type definition. The STPID can overlap with the message or function ID (SUID).
Syntax
#pragma scl_tracepoint(STPID) #pragma scl_tracepoint(STPID, payload)
Parameters | Type | Description |
STPID | Integer | STRIDE Trace Point ID |
payload | Type | Optional name of the data type of the payload, if any. |
Notes
- The STPID consists of a unique 32-bit ID. The STPID value of zero (0) is reserved for the system.
- There are no constraints on different application threads using the same trace point.
- Trace points can use payloads to represent debug information that is being provided to the host Runtime environment.
- The only constraint unique to trace point payloads versus message payloads is that there is no support for pointers within the payloads. The memory block pointed to is not transferred over to the host Runtime environment.
Examples
Two examples using the scl_tracepoint pragma are shown below:
Example 1
The first example defines a trace point that has no associated payload
/* STRIDE Trace Point ID (STPID) */
#define EVENT_OCCURRENCE_TP 4
/* Use the scl_tracepoint pragma to define the trace point */
#pragma scl_tracepoint( EVENT_OCCURRENCE_TP )
Example 2
The second example defines a Trace Point by associating a STRIDE Trace Point Identifier (STPID) with a payload.
/* STRIDE Trace Point ID (STPID) */
#define STAT_INFO_TP 5
/* Structure defining a Trace Point payload */
typedef struct {
short count;
char flag;
} StatInfo_t;
/* Use the scl_tracepoint pragma to associate the payload with the STPID */
#pragma scl_tracepoint( STAT_INFO_TP, StatInfo_t )
See Also
- The scl_tracepoint_format pragma.
- The SCL Structure page for more information on the format of the STRIDE Unique ID (SUID), and STPIDs.
- For additional information on scl_tracepoint, including constraints, refer to the section on scl_tracepoint in the SCL Reference Guide.