Skip to content

Commit

Permalink
Merge branch 'rtt-collector-configs'
Browse files Browse the repository at this point in the history
  • Loading branch information
jonlamb-gh committed Apr 19, 2024
2 parents ea75f7d + c17f5c1 commit 18aa5d6
Show file tree
Hide file tree
Showing 11 changed files with 344 additions and 24 deletions.
74 changes: 73 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "modality-trace-recorder-plugin"
version = "0.12.0"
version = "0.13.0"
edition = "2021"
authors = ["Jon Lamb <[email protected]>"]
description = "A Modality reflector plugin suite and ingest adapter library for Percepio's TraceRecorder data"
Expand Down Expand Up @@ -50,6 +50,9 @@ goblin = "0.8"
clap = { version = "4.5", features = ["derive", "env", "color"] }
ctrlc = { version = "3.4", features=["termination"] }
exitcode = "1"
ratelimit = "0.9"
human_bytes = "0.4"
simple_moving_average = "1.0"
auxon-sdk = { version = "1.3", features = ["modality"] }
trace-recorder-parser = "0.6"

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,16 @@ reflector configuration file, e.g. `[plugins.ingest.collectors.trace-recorder-rt
- `speed` — The protocol speed in kHz. The default value is 4000.
- `core` — The selected core to target. The default value is 0.
- `reset` — Reset the target on startup.
- `attach-under-reset` — Attach to the chip under hard-reset.
This asserts the reset pin via the probe, plays the protocol init routines and deasserts the pin.
- `chip-description-path` — Provides custom target descriptions based on CMSIS Pack files.
See the [probe-rs target extraction](https://probe.rs/docs/knowledge-base/cmsis-packs/#target-extraction) section for
more information.
- `rtt-poll-interval` — The host-side RTT polling interval. The default value is 1ms.
Accepts durations like "10ms" or "1minute 2seconds 22ms".
- `rtt-reader-buffer-size` — Size of the host-side RTT buffer used to store data read off the target.
The default value is 1024.
- `metrics` — Periodically log RTT metrics to stdout that can be used to assess the target and host RTT configuration.

### Configuration Examples

Expand Down
3 changes: 3 additions & 0 deletions src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ pub enum CommonTimelineAttrKey {
#[display(fmt = "timeline.internal.trace_recorder.object_handle")]
ObjectHandle,

#[display(fmt = "timeline.internal.trace_recorder.plugin.version")]
PluginVersion,

#[display(fmt = "timeline.{_0}")]
Custom(String),
}
Expand Down
7 changes: 5 additions & 2 deletions src/bin/importer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use modality_trace_recorder_plugin::{
import::import, tracing::try_init_tracing_subscriber, ImportProtocol, Interruptor,
ReflectorOpts, SnapshotFile, TraceRecorderConfig, TraceRecorderConfigEntry, TraceRecorderOpts,
};
use std::fs::File;
use std::path::PathBuf;
use std::{fs::File, io::BufReader};
use tracing::debug;

/// Import trace recorder data from a file
Expand Down Expand Up @@ -107,7 +107,10 @@ async fn do_main() -> Result<(), Box<dyn std::error::Error>> {
};

let f = SnapshotFile::open(&file_path)?;
let mut join_handle = tokio::spawn(async move { import(File::from(f), protocol, cfg).await });
let mut join_handle = tokio::spawn(async move {
let reader = BufReader::new(File::from(f));
import(reader, protocol, cfg).await
});

tokio::select! {
_ = tokio::signal::ctrl_c() => {
Expand Down
Loading

0 comments on commit 18aa5d6

Please sign in to comment.