Difference between revisions of "Studio:Scl tracepoint"

From STRIDE Wiki
Jump to: navigation, search
(Examples)
(See Also)
Line 63: Line 63:
 
* For additional information on scl_tracepoint, including constraints, refer to the section on scl_tracepoint in the [http://www.s2technologies.com/pdf/s2sSCLReferenceGuide.pdf SCL Reference Guide].
 
* For additional information on scl_tracepoint, including constraints, refer to the section on scl_tracepoint in the [http://www.s2technologies.com/pdf/s2sSCLReferenceGuide.pdf SCL Reference Guide].
  
[[Category: SCL_Reference]]
+
[[Category: SCL]]

Revision as of 12:05, 2 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:

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.