Skip to content

Commit 89efd0e

Browse files
committed
Manually format code since rustfmt chokes on it
1 parent 7dd0821 commit 89efd0e

File tree

1 file changed

+17
-13
lines changed
  • collector/src/compile/execute

1 file changed

+17
-13
lines changed

collector/src/compile/execute/mod.rs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,27 +136,29 @@ pub struct CargoProcess<'a> {
136136
fn performance_cores() -> Option<&'static String> {
137137
use std::sync::LazyLock;
138138
static PERFORMANCE_CORES: LazyLock<Option<String>> = LazyLock::new(|| {
139-
if std::fs::exists("/sys/devices/cpu").expect("Could not check the CPU architecture details: could not check if `/sys/devices/cpu` exists!"){
139+
if std::fs::exists("/sys/devices/cpu").expect("Could not check the CPU architecture details: could not check if `/sys/devices/cpu` exists!") {
140140
// If /sys/devices/cpu exists, then this is not a "Performance-hybrid" CPU.
141-
None
142-
}
143-
else if std::fs::exists("/sys/devices/cpu_core").expect("Could not check the CPU architecture detali: could not check if `/sys/devices/cpu_core` exists!") {
144-
// If /sys/devices/cpu_core exists, then this is a "Performance-hybrid" CPU.
145-
eprintln!("WARNING: Performance-Hybrid CPU detected. `rustc-perf` can't run properly on Efficency cores: test suite will only use Performance cores!");
146-
Some(std::fs::read_to_string("/sys/devices/cpu_core/cpus").unwrap().trim().to_string())
147-
}else{
148-
// If neither dir exists, then something is wrong - `/sys/devices/cpu` has been in Linux for over a decade.
149-
eprintln!("WARNING: neither `/sys/devices/cpu` nor `/sys/devices/cpu_core` present, unable to determine if this CPU has a Performance-Hybrid architecture.");
150-
None
151-
}
141+
None
142+
}
143+
else if std::fs::exists("/sys/devices/cpu_core").expect("Could not check the CPU architecture detali: could not check if `/sys/devices/cpu_core` exists!") {
144+
// If /sys/devices/cpu_core exists, then this is a "Performance-hybrid" CPU.
145+
eprintln!("WARNING: Performance-Hybrid CPU detected. `rustc-perf` can't run properly on Efficency cores: test suite will only use Performance cores!");
146+
Some(std::fs::read_to_string("/sys/devices/cpu_core/cpus").unwrap().trim().to_string())
147+
} else {
148+
// If neither dir exists, then something is wrong - `/sys/devices/cpu` has been in Linux for over a decade.
149+
eprintln!("WARNING: neither `/sys/devices/cpu` nor `/sys/devices/cpu_core` present, unable to determine if this CPU has a Performance-Hybrid architecture.");
150+
None
151+
}
152152
});
153153
(*PERFORMANCE_CORES).as_ref()
154154
}
155+
155156
#[cfg(not(target_os = "linux"))]
156157
// Modify this stub if you want to add support for P/E cores on more OSs
157158
fn performance_cores() -> Option<&'static String> {
158159
None
159160
}
161+
160162
#[cfg(target_os = "linux")]
161163
/// Makes the benchmark run only on Performance cores.
162164
fn run_on_p_cores(path: &Path, cpu_list: &str) -> Command {
@@ -183,11 +185,13 @@ fn run_on_p_cores(path: &Path, cpu_list: &str) -> Command {
183185
cmd.arg(path);
184186
cmd
185187
}
188+
186189
#[cfg(not(target_os = "linux"))]
187190
// Modify this stub if you want to add support for P/E cores on more OSs
188191
fn run_on_p_cores(_path: &Path, _cpu_list: &str) -> Command {
189-
todo!("Can't run comamnds on the P cores on this platform")
192+
todo!("Can't run commands on the P cores on this platform");
190193
}
194+
191195
impl<'a> CargoProcess<'a> {
192196
pub fn incremental(mut self, incremental: bool) -> Self {
193197
self.incremental = incremental;

0 commit comments

Comments
 (0)