Use main_core to determine slice
This commit is contained in:
parent
989ae0c0ea
commit
a17aeb33c7
@ -24,7 +24,7 @@ pub fn main() {
|
|||||||
cpu_set.set(core).unwrap();
|
cpu_set.set(core).unwrap();
|
||||||
sched_setaffinity(Pid::this(), &cpu_set).unwrap();
|
sched_setaffinity(Pid::this(), &cpu_set).unwrap();
|
||||||
for addr in target.iter() {
|
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 {
|
match slice {
|
||||||
Some(slice) => {
|
Some(slice) => {
|
||||||
println!("({:2}) Slice for addr {:x}: {}", core, addr as *const u64 as usize, 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() {
|
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 {
|
match slice {
|
||||||
Some(slice) => {
|
Some(slice) => {
|
||||||
println!("({:2}) Slice for addr {:x}: {}", core, addr as *const u64 as usize, slice)
|
println!("({:2}) Slice for addr {:x}: {}", core, addr as *const u64 as usize, slice)
|
||||||
|
@ -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<u16>) -> Option<usize> {
|
pub fn determine_slice(addr: *const u8, core: u8, nb_cores: u16) -> Option<usize> {
|
||||||
let res = unsafe {
|
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();
|
}.unwrap();
|
||||||
|
|
||||||
let slice = res.iter().enumerate().max_by_key(|(_i, val)| { **val });
|
let slice = res.iter().enumerate().max_by_key(|(_i, val)| { **val });
|
||||||
|
@ -219,7 +219,7 @@ fn calibrate_fixed_freq_2_thread_impl<I: Iterator<Item = (usize, usize)>, T>(
|
|||||||
params.address = pointer;
|
params.address = pointer;
|
||||||
|
|
||||||
//let hash = slicing.hash(pointer as usize);
|
//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 {
|
if options.verbosity >= Thresholds {
|
||||||
print!("Calibration for {:p}", pointer);
|
print!("Calibration for {:p}", pointer);
|
||||||
|
Loading…
Reference in New Issue
Block a user