µ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

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

Definition at line 169 of file trace.h.

170 {
172 }
void trace_dbg_bkpt(void)
Insert a BKPT0 for debugger usage.
Definition trace.h:50

References trace_dbg_bkpt().

◆ flush()

void os::trace::flush ( void  )
Parameters
None.
Returns
Nothing.

Definition at line 52 of file trace.cpp.

53 {
54 }

Referenced by trace_flush().

◆ initialize()

void os::trace::initialize ( void  )

Definition at line 37 of file trace.cpp.

38 {
39 }

Referenced by trace_initialize().

◆ write()

ssize_t os::trace::write ( const void *  buf,
std::size_t  nbyte 
)
Returns
The number of characters actually written, or -1 if error.

Definition at line 46 of file trace.cpp.

47 {
48 return static_cast<ssize_t> (nbyte);
49 }

Referenced by putchar(), puts(), trace_write(), and vprintf().