rtos-trace

Set of traits used to trace RTOS internals.

Features

Implementation

The backend is required implement [`RtosTrace].

Existing implementation: - SEGGER SystemView

Usage

RTOS

The RTOS can implement [RtosTraceOSCallbacks] to provide additional information upon request from the tracing software. For example: ```rust rtostrace::globalos_callbacks!{Scheduler}

impl rtostrace::RtosTraceOSCallbacks for Scheduler { fn tasklist() { /../ for task in tasks.iter() { trace::tasksendinfo(task.id(), task.info()); } } /../ } ```

Usage for the RTOS maintainer is simple: ```rust use rtos_trace::{RtosTrace, trace}

pub fn spawntask(/*..*/) { /*..*/ trace::tasknew(task_id); } ```

Application

Similar to a global logger the user must provide a tracing backend, i.e.: ìgnore use systemview_target::SystemView; rtos_trace::global_trace!{SystemView}

The user can implement [RtosTraceApplicationCallbacks] to provide additional information upon request from the tracing software. For example: ```rust struct Application; rtostrace::globalapplication_callbacks!{Application}

impl rtostrace::RtosTraceApplicationCallbacks for Application { fn systemdescription() { systemviewtarget::sendsystemdescappname!("Espresso Machine"); systemviewtarget::sendsystemdescdevice!("STM32F769NI"); systemviewtarget::sendsystemdesccore!("Cortex-M7"); systemviewtarget::sendsystemdescos!("Bern RTOS"); systemviewtarget::sendsystemdesc_interrupt!(15, "SysTick"); } /../ }

```