summaryrefslogtreecommitdiff
path: root/src/benchmark.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/benchmark.rs')
-rw-r--r--src/benchmark.rs22
1 files changed, 3 insertions, 19 deletions
diff --git a/src/benchmark.rs b/src/benchmark.rs
index c6795df..435ad38 100644
--- a/src/benchmark.rs
+++ b/src/benchmark.rs
@@ -18,7 +18,7 @@ use std::{fs::File, sync::atomic::AtomicI32};
const SLICE_US: u64 = 5000;
const LOG_INTERVAL_MS: u64 = 10;
-const RESHUFFLE_ROUNDS: usize = 1000; // Number of rounds before changing cpu
+const ROUNDS_PER_CPU: usize = 1000; // Number of rounds before changing cpu
type Pid = i32;
static CPU: AtomicI32 = AtomicI32::new(0);
@@ -30,22 +30,6 @@ pub struct BenchmarkScheduler<'a> {
e_cores: Range<i32>,
}
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
-pub enum Mode {
- ECores,
- PCores,
-}
-
-impl From<char> for Mode {
- fn from(value: char) -> Self {
- match value {
- 'p' => Mode::PCores,
- 'e' => Mode::ECores,
- _ => panic!("{} is not a valid benchmarking mode", value),
- }
- }
-}
-
// Represents a single measurement point in time
struct Measurement {
timestamp: Instant,
@@ -327,8 +311,8 @@ fn run_measurement_loop(log_path: String, p_core: i32, e_core: i32) -> Result<()
// println!("Took initial measurement");
- // Monitor for several rounds before reshuffling
- for round in 0..RESHUFFLE_ROUNDS {
+ // Monitor for several rounds before changing CPU
+ for round in 0..ROUNDS_PER_CPU {
group.enable().unwrap();
group.reset().unwrap();
// Wait for the sampling interval