From 75366d349b98e02d1d8c5a145ee2ce2442251d1d Mon Sep 17 00:00:00 2001 From: Jon Lamb Date: Mon, 23 Sep 2024 10:30:19 -0700 Subject: [PATCH] Update proxy collector --- Cargo.lock | 14 +++++++------- src/bin/proxy_collector.rs | 34 ++++++++++++++++++++++++++++++++++ src/config.rs | 2 ++ 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9a57c38..64beb0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1718,9 +1718,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "plain" @@ -1943,7 +1943,7 @@ dependencies = [ [[package]] name = "rtt-proxy" version = "0.1.0" -source = "git+https://github.com/auxoncorp/trace-recorder-rtt-proxy.git?branch=main#90050db5657c7e1c22505b941d6caa429699dd94" +source = "git+https://github.com/auxoncorp/trace-recorder-rtt-proxy.git?branch=main#e75e44bb75802cdddd954fe725d785d6229d9613" dependencies = [ "serde", "uuid", @@ -2301,18 +2301,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", diff --git a/src/bin/proxy_collector.rs b/src/bin/proxy_collector.rs index e428d55..74b5ea6 100644 --- a/src/bin/proxy_collector.rs +++ b/src/bin/proxy_collector.rs @@ -85,6 +85,29 @@ pub struct Opts { )] pub thumb: bool, + /// This session will have exclusive access to the core's + /// control functionality (i.e. hardware breakpoints, reset, etc). + /// If another session (i.e. the application to be booted by the bootloader) + /// is requested on this core, it will be suspended until this session + /// signals completion. + #[clap( + long, + name = "bootloader", + conflicts_with = "bootloader-companion-application", + help_heading = "STREAMING PORT CONFIGURATION" + )] + pub bootloader: bool, + + /// This session will not drive any of the core's + /// control functionality (i.e. hardware breakpoints, reset, etc) + #[clap( + long, + name = "bootloader-companion-application", + conflicts_with = "bootloader", + help_heading = "STREAMING PORT CONFIGURATION" + )] + pub bootloader_companion_application: bool, + /// Disable sending control plane commands to the target. /// By default, CMD_SET_ACTIVE is sent on startup and shutdown to /// start and stop tracing on the target. @@ -363,6 +386,12 @@ async fn do_main() -> Result<(), Box> { if opts.auto_recover { cfg.plugin.proxy_collector.auto_recover = true; } + if opts.bootloader { + cfg.plugin.proxy_collector.bootloader = true; + } + if opts.bootloader_companion_application { + cfg.plugin.proxy_collector.bootloader_companion_application = true; + } let remote_string = if let Some(remote) = cfg.plugin.proxy_collector.remote.as_ref() { remote.clone() @@ -502,6 +531,11 @@ async fn do_main() -> Result<(), Box> { auto_recover: cfg.plugin.proxy_collector.auto_recover, core: cfg.plugin.proxy_collector.rtt.core as _, reset: cfg.plugin.proxy_collector.rtt.reset, + bootloader: cfg.plugin.proxy_collector.bootloader, + bootloader_companion_application: cfg + .plugin + .proxy_collector + .bootloader_companion_application, }, rtt: rtt_proxy::RttConfig { attach_timeout_ms: cfg diff --git a/src/config.rs b/src/config.rs index 1e22573..1428f3a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -199,6 +199,8 @@ pub struct ProxyCollectorConfig { pub auto_recover: bool, pub stop_on_breakpoint: Option, pub no_data_stop_timeout: Option, + pub bootloader: bool, + pub bootloader_companion_application: bool, pub remote: Option, }