diff --git a/cache_slice/src/bin/scan.rs b/cache_slice/src/bin/scan.rs index edbd70c..645e5cf 100644 --- a/cache_slice/src/bin/scan.rs +++ b/cache_slice/src/bin/scan.rs @@ -24,7 +24,7 @@ pub fn main() { cpu_set.set(core).unwrap(); sched_setaffinity(Pid::this(), &cpu_set).unwrap(); for addr in target.iter() { - let slice = determine_slice(addr, nb_cores, Some(core)); + let slice = determine_slice(addr as *const u64 as *const u8, core as u8, nb_cores); match slice { Some(slice) => { println!("({:2}) Slice for addr {:x}: {}", core, addr as *const u64 as usize, slice) @@ -35,7 +35,7 @@ pub fn main() { } } for addr in target.iter() { - let slice = determine_slice(addr, nb_cores, Some(0)); + let slice = determine_slice(addr as *const u64 as *const u8, 0, nb_cores); match slice { Some(slice) => { println!("({:2}) Slice for addr {:x}: {}", core, addr as *const u64 as usize, slice) diff --git a/cache_slice/src/lib.rs b/cache_slice/src/lib.rs index e59c323..8c443fa 100644 --- a/cache_slice/src/lib.rs +++ b/cache_slice/src/lib.rs @@ -125,9 +125,9 @@ pub unsafe fn monitor_address(addr: *const u8, cpu: u8, max_cbox: u16) -> Result } } -pub fn determine_slice(addr: *const u8, nb_cores: u16, core: Option) -> Option { +pub fn determine_slice(addr: *const u8, core: u8, nb_cores: u16) -> Option { let res = unsafe { - monitor_address(addr as *const u64 as *const u8, core.unwrap_or(0) as u8, nb_cores) + monitor_address(addr, core, nb_cores) }.unwrap(); let slice = res.iter().enumerate().max_by_key(|(_i, val)| { **val }); diff --git a/cache_utils/src/calibrate_2t.rs b/cache_utils/src/calibrate_2t.rs index 16e7164..739d559 100644 --- a/cache_utils/src/calibrate_2t.rs +++ b/cache_utils/src/calibrate_2t.rs @@ -219,7 +219,7 @@ fn calibrate_fixed_freq_2_thread_impl, T>( params.address = pointer; //let hash = slicing.hash(pointer as usize); - let hash = determine_slice(pointer, nb_cores, None).unwrap(); + let hash = determine_slice(pointer, main_core as u8, nb_cores).unwrap(); if options.verbosity >= Thresholds { print!("Calibration for {:p}", pointer);