µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches
os::trace Namespace Reference

Tracing support namespace. More...

Functions

void dbg_bkpt (void)
 Insert a BKPT0 for debugger usage.
 
void dump_args (int argc, char *argv[])
 Write the argv[] array to the trace device.
 
void flush (void)
 Flush the output.
 
void initialize (void)
 
int printf (const char *format,...)
 Write a formatted string to the trace device.
 
int putchar (int c)
 Write the single character to the trace device.
 
int puts (const char *s)
 Write the string and a line terminator to the trace device.
 
int vprintf (const char *format, std::va_list args)
 Write a formatted variable arguments list to the trace device.
 
ssize_t write (const void *buf, std::size_t nbyte)
 Write the given number of bytes to the trace output channel.
 

Detailed Description

Tracing support namespace.

The trace device is an independent output channel, intended for diagnostic purposes.

The API is simple, and mimics the standard C output calls:

The implementation is done in:

If these functions are not defined in another place, there are weak definitions that simply discard the trace output.

Trace support is enabled by adding the TRACE macro definition.

When TRACE is not defined, all functions are inlined to empty bodies. This has the advantage that the trace calls do not need to be conditionally compiled with #ifdef TRACE / #endif

Function Documentation

◆ dbg_bkpt()

void os::trace::dbg_bkpt ( void  )
inline

Insert a BKPT0 for debugger usage.

Definition at line 171 of file trace.h.

◆ flush()

void os::trace::flush ( void  )

Flush the output.

Parameters
None.
Returns
Nothing.

Definition at line 53 of file trace.cpp.

◆ initialize()

void os::trace::initialize ( void  )

Definition at line 38 of file trace.cpp.

◆ write()

ssize_t os::trace::write ( const void *  buf,
std::size_t  nbyte 
)

Write the given number of bytes to the trace output channel.

Returns
The number of characters actually written, or -1 if error.

Definition at line 47 of file trace.cpp.