Difference between revisions of "Studio:Scl tracepoint"

From STRIDE Wiki
Jump to: navigation, search
(New page: = 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...)
 
(Example 1)
Line 36: Line 36:
  
 
===Example 1===
 
===Example 1===
    /* STRIDE Trace Point ID (STPID) */
+
<source lang=c>
    #define EVENT_OCCURRENCE_TP  4
+
/* STRIDE Trace Point ID (STPID) */
    /* Use the scl_tracepoint pragma to define the trace point */
+
#define EVENT_OCCURRENCE_TP  4
    #pragma scl_tracepoint( EVENT_OCCURRENCE_TP )
+
/* Use the scl_tracepoint pragma to define the trace point */
 +
#pragma scl_tracepoint( EVENT_OCCURRENCE_TP )
 +
</source>
  
 
===Example 2===
 
===Example 2===

Revision as of 18:33, 1 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 embedded pointers. 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:

  1. The first example defines a trace point that has no associated payload.
  2. The second example defines a Trace Point by associating a STRIDE Trace Point Identifier (STPID) with a payload.

Example 1

/* 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

   /*  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].