Skip to content

Commit

Permalink
add hardware events tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaumy committed Mar 19, 2024
1 parent a098233 commit a66d018
Showing 1 changed file with 57 additions and 1 deletion.
58 changes: 57 additions & 1 deletion src/perf_event/counting/single/tests/hardware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use crate::counting::single::tests::test_single;
use crate::test::cpu_workload;
use crate::{Event, HardwareEvent};
use crate::{Event, HardwareEvent, RawEvent};

#[test]
fn test_cpu_cycles() {
Expand All @@ -23,3 +23,59 @@ fn test_cpu_cycles() {

test_single(&Event::from(ev), &mut workload);
}

#[test]
fn test_r11() {
let ev = unsafe { RawEvent::new(0x11) };
let mut workload = cpu_workload;

test_single(&Event::from(ev), &mut workload);
}

#[test]
fn test_r1b() {
let ev = unsafe { RawEvent::new(0x1b) };
let mut workload = cpu_workload;

test_single(&Event::from(ev), &mut workload);
}

#[test]
fn test_r70() {
let ev = unsafe { RawEvent::new(0x70) };
let mut workload = cpu_workload;

test_single(&Event::from(ev), &mut workload);
}

#[test]
fn test_r71() {
let ev = unsafe { RawEvent::new(0x71) };
let mut workload = cpu_workload;

test_single(&Event::from(ev), &mut workload);
}

#[test]
fn test_r73() {
let ev = unsafe { RawEvent::new(0x73) };
let mut workload = cpu_workload;

test_single(&Event::from(ev), &mut workload);
}

#[test]
fn test_r75() {
let ev = unsafe { RawEvent::new(0x75) };
let mut workload = cpu_workload;

test_single(&Event::from(ev), &mut workload);
}

#[test]
fn test_r8004() {
let ev = unsafe { RawEvent::new(0x8004) };
let mut workload = cpu_workload;

test_single(&Event::from(ev), &mut workload);
}

0 comments on commit a66d018

Please sign in to comment.