Skip to content

Commit

Permalink
add tests for aarch64 target arch
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaumy committed Mar 20, 2024
1 parent 6ff5892 commit e2ca783
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/perf_event/counting/group/tests/hardware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ fn test_ipc() {

test_group(&Event::from(ev_1), &Event::from(ev_2), &mut workload);
}

#[test]
#[cfg(target_arch = "aarch64")]
fn test_r11_r1b() {
let ev_1 = unsafe { crate::RawEvent::new(0x11) };
let ev_2 = unsafe { crate::RawEvent::new(0x1b) };
let mut workload = cpu_workload;

test_group(&Event::from(ev_1), &Event::from(ev_2), &mut workload);
}
18 changes: 18 additions & 0 deletions src/perf_event/counting/single/tests/hardware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,21 @@ fn test_cpu_cycles() {

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

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

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

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

test_single(&Event::from(ev), &mut workload);
}
10 changes: 10 additions & 0 deletions src/perf_event/sampling/group/tests/hardware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,13 @@ fn test_ipc() {

test_group(&Event::from(ev_1), &Event::from(ev_2), &mut workload);
}

#[test]
#[cfg(target_arch = "aarch64")]
fn test_r11_r1b() {
let ev_1 = unsafe { crate::RawEvent::new(0x11) };
let ev_2 = unsafe { crate::RawEvent::new(0x1b) };
let mut workload = cpu_workload;

test_group(&Event::from(ev_1), &Event::from(ev_2), &mut workload);
}
19 changes: 19 additions & 0 deletions src/perf_event/sampling/single/tests/hardware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,24 @@ use crate::{Event, HardwareEvent};
fn test_cpu_cycles() {
let ev = HardwareEvent::CpuCycles;
let mut workload = cpu_workload;

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

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

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

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

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

0 comments on commit e2ca783

Please sign in to comment.