diag-trace 5.0.0
µOS++ Tracing Infrastructure
Loading...
Searching...
No Matches
Implementation functions

C wrappers for the user-supplied back-end primitives. More...

Functions

void micro_os_plus_trace_flush (void)
 Flush the trace output channel.
void micro_os_plus_trace_initialise (void)
 Initialise the trace output channel.
ssize_t micro_os_plus_trace_write (const void *buf, size_t nbyte)
 Write the given number of bytes to the trace output channel.

Detailed Description

These functions may be invoked from C projects to execute actions specific to the implementation.

Function Documentation

◆ micro_os_plus_trace_flush()

void micro_os_plus_trace_flush ( void )
Parameters
None.
Returns
Nothing.

For buffered output channels, this function must drain any internally buffered data to the output device. For unbuffered or character-mode channels (e.g. ITM), the body can be left empty. No assumptions are made about thread safety or re-entrancy; the caller is responsible for ensuring that concurrent calls do not occur.

Definition at line 58 of file trace-c-api.cpp.

59{
61}
static void flush(void) noexcept(noexcept(T::flush()))
Flush the trace output channel.

References micro_os_plus::trace::detail::tracer< T >::flush().

◆ micro_os_plus_trace_initialise()

void micro_os_plus_trace_initialise ( void )
Parameters
None.
Returns
Nothing.

This function is called during startup, as early as possible, to enable the trace channel. The user must provide a definition of this function that configures the underlying output device (e.g. a semihosting channel, or an ITM port).

Definition at line 46 of file trace-c-api.cpp.

47{
49}
static void initialise(void) noexcept(noexcept(T::initialise()))
Initialise the trace output channel.

References micro_os_plus::trace::detail::tracer< T >::initialise().

◆ micro_os_plus_trace_write()

ssize_t micro_os_plus_trace_write ( const void * buf,
size_t nbyte )
Parameters
bufAn array of bytes.
nbyteThe number of bytes in the array.
Returns
The number of bytes actually written, or -1 if error.

This is the core output primitive. The user must provide a definition of this function. The return value must reflect the number of bytes actually transferred to the output device, which may be less than nbyte if the device is full or an error occurs. A return value of -1 signals an error; any non-negative value is treated as a byte count by the higher-level functions.

Definition at line 52 of file trace-c-api.cpp.

53{
54 return tracer<implementation>::write (buf, nbyte);
55}
static ssize_t write(const void *buf, std::size_t nbyte) noexcept(noexcept(T::write(buf, nbyte)))
Write the given number of bytes to the trace output channel.

References micro_os_plus::trace::detail::tracer< T >::write().