From 73248b1d9082c0cace27b97281b6f8da7042313d Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Fri, 28 Mar 2025 13:21:49 +0100 Subject: Use pm1 counter values --- src/benchmark.rs | 56 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'src') diff --git a/src/benchmark.rs b/src/benchmark.rs index 6487c7a..6701f0c 100644 --- a/src/benchmark.rs +++ b/src/benchmark.rs @@ -17,10 +17,10 @@ use std::thread; use std::time::{Duration, Instant}; const SLICE_US: u64 = 50000; -const LOG_INTERVAL_MS: u64 = 5; // Log every 1 second - // const RESHUFFLE_ROUNDS: usize = 5; // Number of rounds before reshuffling counters +const LOG_INTERVAL_MS: u64 = 10; // Log every 1 second + // const RESHUFFLE_ROUNDS: usize = 5; // Number of rounds before reshuffling counters const RESHUFFLE_ROUNDS: usize = 1; // Number of rounds before reshuffling counters -const MAX_COUNTERS_AT_ONCE: usize = 5; +const MAX_COUNTERS_AT_ONCE: usize = 7; type Pid = i32; @@ -131,7 +131,7 @@ impl MeasurementDiff { // Write record writer.write_record(&record)?; - writer.flush()?; + // writer.flush()?; Ok(()) } @@ -383,30 +383,30 @@ fn define_available_events() -> Vec<(String, Event)> { "instructions".to_string(), Event::Hardware(Hardware::INSTRUCTIONS), ), - // ( - // "cache_references".to_string(), - // Event::Hardware(Hardware::CACHE_REFERENCES), - // ), - // ( - // "cache_misses".to_string(), - // Event::Hardware(Hardware::CACHE_MISSES), - // ), - // ( - // "branch_instructions".to_string(), - // Event::Hardware(Hardware::BRANCH_INSTRUCTIONS), - // ), - // ( - // "branch_misses".to_string(), - // Event::Hardware(Hardware::BRANCH_MISSES), - // ), ( - "ref_cpu_cycles".to_string(), - Event::Hardware(Hardware::REF_CPU_CYCLES), + "cache_references".to_string(), + Event::Hardware(Hardware::CACHE_REFERENCES), + ), + ( + "cache_misses".to_string(), + Event::Hardware(Hardware::CACHE_MISSES), + ), + ( + "branch_instructions".to_string(), + Event::Hardware(Hardware::BRANCH_INSTRUCTIONS), ), ( - "stalled-cycles-frontend".to_string(), - Event::Hardware(Hardware::STALLED_CYCLES_FRONTEND), + "branch_misses".to_string(), + Event::Hardware(Hardware::BRANCH_MISSES), ), + ( + "ref_cpu_cycles".to_string(), + Event::Hardware(Hardware::REF_CPU_CYCLES), + ), + // ( + // "stalled-cycles-frontend".to_string(), + // Event::Hardware(Hardware::STALLED_CYCLES_FRONTEND), + // ), ]); // L1 Data Cache events @@ -433,10 +433,10 @@ fn define_available_events() -> Vec<(String, Event)> { // "fp_ops_retired_by_type.all".to_string(), // Event::Raw(4, 0xFF0A), // EventCode 0x0A with UMask 0xFF // )); - events.push(( - "sse_avx_ops_retired.all".to_string(), - Event::Raw(4, 0xFF0B), // EventCode 0x0B with UMask 0xFF - )); + // events.push(( + // "sse_avx_ops_retired.all".to_string(), + // Event::Raw(4, 0xFF0B), // EventCode 0x0B with UMask 0xFF + // )); // L1 Instruction Cache events events.extend([ -- cgit v1.3.1