Docs.rs
  • rtos-trace-0.1.3
    • rtos-trace 0.1.3
    • Docs.rs crate page
    • MIT
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • stefanluethi
    • Dependencies
    • Versions
    • 56.25% of the crate is documented
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate rtos_trace

rtos_trace0.1.3

  • All Items

Sections

  • Features
  • Implementation
  • Usage
    • RTOS
    • Application

Crate Items

  • Modules
  • Macros
  • Structs
  • Traits

Crates

  • rtos_trace

Crate rtos_trace

Source
Expand description

Set of traits used to trace RTOS internals.

§Features

  • trace_impl: Activates tracing function (on by default). Can be used by the RTOS to deactivate tracing.

§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:

ⓘ
rtos_trace::global_os_callbacks!{Scheduler}
 
impl rtos_trace::RtosTraceOSCallbacks for Scheduler {
    fn task_list() {
        /*..*/
        for task in tasks.iter() {
            trace::task_send_info(task.id(), task.info());
        }
    }
    /*..*/
}

Usage for the RTOS maintainer is simple:

ⓘ
use rtos_trace::{RtosTrace, trace}
 
pub fn spawn_task(/*..*/) {
    /*..*/
    trace::task_new(task_id);
}

§Application

Similar to a global logger the user must provide a tracing backend, i.e.:

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:

ⓘ
struct Application;
rtos_trace::global_application_callbacks!{Application}
 
impl rtos_trace::RtosTraceApplicationCallbacks for Application {
    fn system_description() {
        systemview_target::send_system_desc_app_name!("Espresso Machine");
        systemview_target::send_system_desc_device!("STM32F769NI");
        systemview_target::send_system_desc_core!("Cortex-M7");
        systemview_target::send_system_desc_os!("Bern RTOS");
        systemview_target::send_system_desc_interrupt!(15, "SysTick");
    }
    /*..*/
}
 

Modules§

trace

Macros§

global_application_callbacks
global_os_callbacks
global_trace

Structs§

TaskInfo
Task info block.

Traits§

RtosTrace
Collection of tracing functions which are called by the RTOS.
RtosTraceApplicationCallbacks
Callbacks to the application invoked by the tracing system. This trait can be implemented by user.
RtosTraceOSCallbacks
Callbacks to the OS invoked by the tracing system. This trait can be implemented in the RTOS.

Results

Settings
Help
    trait
    rtos_trace::RtosTraceApplicationCallbacks
    Callbacks to the application invoked by the tracing system.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.
No results :(
Try on DuckDuckGo?

Or try looking in one of these:
  • The Rust Reference for technical details about the language.
  • Rust By Example for expository code examples.
  • The Rust Book for introductions to language features and the language itself.
  • Docs.rs for documentation of crates released on crates.io.