diag-trace 5.0.1
µOS++ Tracing Infrastructure
Loading...
Searching...
No Matches

Configuration macros. More...

Macros

#define MICRO_OS_PLUS_DIAG_TRACE_ENABLED
 Enables the output of trace messages.
#define MICRO_OS_PLUS_DIAG_TRACE_PRINTF_BUFFER_ARRAY_SIZE_INTEGER   (200)
 The size, in bytes, of the stack buffer used to format trace messages.

Detailed Description

The µOS++ Tracing Infrastructure library uses several preprocessor macros to enable it and to configure various options.

Macro Definition Documentation

◆ MICRO_OS_PLUS_DIAG_TRACE_ENABLED

#define MICRO_OS_PLUS_DIAG_TRACE_ENABLED

The macro is intended to be defined by the user, for debug builds, typically in the library's own micro-os-plus/diag/trace-defines.h configuration file or the project micro-os-plus/project-config.h configuration file.

When MICRO_OS_PLUS_DIAG_TRACE_ENABLED is defined, the C++ and C trace functions are compiled to their full implementations, declared in cpp-api.h and c-api.h, which forward all calls to micro_os_plus::trace::detail::tracer<micro_os_plus::trace::detail::implementation>.

When it is not defined, which is the usual case for release builds, all trace functions are inlined to empty (or trivial pass-through) bodies. This approach allows trace calls to remain in the code unconditionally, without being wrapped in #if defined(MICRO_OS_PLUS_DIAG_TRACE_ENABLED) guards, while still being fully eliminated from the generated binary.

Definition at line 51 of file trace.h.

◆ MICRO_OS_PLUS_DIAG_TRACE_PRINTF_BUFFER_ARRAY_SIZE_INTEGER

#define MICRO_OS_PLUS_DIAG_TRACE_PRINTF_BUFFER_ARRAY_SIZE_INTEGER   (200)

This buffer is allocated on the stack by tracer<T>::vprintf() to hold the message formatted by vsnprintf() before it is forwarded to the trace channel write() implementation. Output that exceeds this size is silently truncated.

The definition below only supplies the default value (200 bytes), used when the macro has not already been defined; the actual value may be overridden by the user, typically in the library's own micro-os-plus/diag/trace-defines.h configuration file or the project micro-os-plus/project-config.h configuration file.

Definition at line 55 of file trace.h.

Referenced by micro_os_plus::trace::detail::tracer< T >::vprintf().