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. //