|
diag-trace 4.2.1
The µOS++ Tracing Infrastructure
|
Tracing support namespace. More...
Functions | |
| void | dump_args (int argc, char *argv[], const char *name="main") |
Send the argv[] array to the trace output channel. | |
| void | flush (void) |
| Flush the trace output channel. | |
| void | initialize (void) |
| Initialize the trace output channel. | |
| int | printf (const char *format,...) |
| Write a formatted string to the trace output channel. | |
| int | putchar (int c) |
| Write the single character to the trace output channel. | |
| int | puts (const char *s="") |
| Write the string and a line terminator to the trace output channel. | |
| int | vprintf (const char *format, std::va_list arguments) |
| Write a formatted variable arguments list to the trace output channel. | |
| ssize_t | write (const void *buf, std::size_t nbyte) |
| Write the given number of bytes to the trace output channel. | |
Tracing support namespace.
The trace channel functions as a standalone output device designed specifically for diagnostic purposes.
The API is straightforward and emulates the standard C output calls:
micro_os_plus::trace::printf() / micro_os_plus_trace_printf()micro_os_plus::trace::puts() / micro_os_plus_trace_puts()micro_os_plus::trace::putchar() / micro_os_plus_trace_putchar()The user is required to provide implementations for the following:
Trace support is activated by adding the MICRO_OS_PLUS_TRACE macro definition to the compiler line.
When MICRO_OS_PLUS_TRACE is not defined, all functions are inlined to empty bodies. This approach eliminates the need for trace calls to be conditionally compiled using #if defined(MICRO_OS_PLUS_TRACE) and #endif. However, the drawback is that the associated header file must always be included.