From 901525e3c9748debae475153d47c83f464f3a09a Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 23 Oct 2022 23:17:16 +0800 Subject: [PATCH] handle multiple performance manager options by default, shellchat drives the performance management interface. But if an alternative one is specified, it overrides shellchat. --- xtask/src/builder.rs | 4 ++++ xtask/src/main.rs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/xtask/src/builder.rs b/xtask/src/builder.rs index ad085aa3a..32a50b7af 100644 --- a/xtask/src/builder.rs +++ b/xtask/src/builder.rs @@ -257,6 +257,10 @@ impl Builder { self.features.retain(|x| x != feature); self } + /// test if a feature is present + pub fn has_feature(&self, feature: &str) -> bool { + self.features.contains(feature) + } /// add a feature to be passed on to just the loader pub fn add_loader_feature<'a>(&'a mut self, feature: &str) -> &'a mut Builder { self.loader_features.push(feature.into()); diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 391083c26..e1e5794ec 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -272,6 +272,11 @@ fn main() -> Result<(), Box> { .add_apps(&get_cratespecs()); } Some("perf-image") => { + // `--feature vaultperf` will make `vault` the performance manager, in exclusion of shellchat + if !build.contains("shellperf") && !builder.contains("vaultperf") { + // select `shellchat` as the performance manager by default. + builder.add_feature("shellperf"); + } // note: to use this image, you need to load a version of the SOC that has the performance counters built in. // this can be generated using the command `python3 .\betrusted_soc.py -e .\dummy.nky --perfcounter` in the betrusted-soc repo. //