Kanzi 4.1.1
Scope macros

Use trace scope macros add execution scopes to the tracing subsystem. More...

Collaboration diagram for Scope macros:

Macros

#define kzTrace(category, name)
 Traces a scope using the tracing subsystem.
 
#define kzTraceDynamic(category, name)
 Traces a scope using the tracing subsystem with a dynamic scope name.
 
#define kzTraceInstant(category, name)
 Traces an instant event to the tracing subsystem.
 
#define kzTraceSample(category, name, sample)
 Traces a sample using the tracing subsystem.
 

Detailed Description

Use trace scope macros add execution scopes to the tracing subsystem.

Use the KANZI_TRACING_BUILD macro to check whether the code is compiled with the Kanzi Tracing build configuration. The KANZI_TRACING_BUILD macro is not defined for the Release build.

Macro Definition Documentation

◆ kzTrace

#define kzTrace ( category,
name )

Traces a scope using the tracing subsystem.

Call the macro in the beginning of a function or scope that you want to trace.

This macro definition is empty when KANZI_TRACING_BUILD is not defined.

Parameters
categoryThe tracing category.
nameThe scope name.

◆ kzTraceDynamic

#define kzTraceDynamic ( category,
name )

Traces a scope using the tracing subsystem with a dynamic scope name.

Call the macro in the beginning of a function or scope that you want to trace.

This macro definition is empty when KANZI_TRACING_BUILD is not defined.

Parameters
categoryThe tracing category.
nameThe dynamic scope name.

◆ kzTraceInstant

#define kzTraceInstant ( category,
name )

Traces an instant event to the tracing subsystem.

This macro definition is empty when KANZI_TRACING_BUILD is not defined.

Parameters
categoryThe tracing category.
nameThe event name.

◆ kzTraceSample

#define kzTraceSample ( category,
name,
sample )

Traces a sample using the tracing subsystem.

This macro definition is empty when KANZI_TRACING_BUILD is not defined.

A floating point sample whose value is not a finite number (NaN or infinity) is recorded, but is omitted when the trace is written to a file, because such values have no valid JSON representation and would corrupt the trace output.

See also
logTraceToFile()
Parameters
categoryThe tracing category.
nameThe sample name.
sampleThe integral or floating point sample value.