Studio:Scl tracepoint format

From STRIDE Wiki
Jump to: navigation, search

The scl_tracepoint_format pragma

The scl_tracepoint_format pragma defines a format string for a printf-style trace point.

Syntax

#pragma scl_tracepoint_format(STPID, format-string)

#pragma scl_tracepoint_format(STPID, format-string, format-args)
Parameters Type Description
STPID Integer STRIDE Trace Point ID; the trace point corresponding to this STPID must have been previously specified via scl_tracepoint.
format-string Quoted String Format string, analogous to the format string parameter for the standard printf function in C.
format-args Variable Optional arguments for format string, similar to printf in C. Arguments can be constants or field specifiers of the trace point payload.

Examples

#define MySimpleTrace 30
#pragma scl_tracepoint ( MySimpleTrace )
#pragma scl_tracepoint_format ( MySimpleTrace, "MySimpleTrace: Hi There" )

#define MySTPID 31
typedef struct {
  char cChannel;
  short wRSSIAvg;
  long dwOtherData;
} StatInfo_s;
#pragma scl_tracepoint ( MySTPID, StatInfo_s )
#pragma scl_tracepoint_format ( MySTPID, "rssi average = %u, other = %i", wRSSIAvg, dwOtherData )

See Also

  • The scl_tracepoint 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_format, including constraints, refer to the section on scl_tracepoint_format in the SCL Reference Guide.