MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / assert_load_bias

Function assert_load_bias

src/executor/shared/module_artifacts/unwind_data.rs:114–130  ·  view source on GitHub ↗
(
        start_addr: u64,
        end_addr: u64,
        file_offset: u64,
        module_path: &str,
        expected_load_bias: u64,
    )

Source from the content-addressed store, hash-verified

112 use super::*;
113
114 fn assert_load_bias(
115 start_addr: u64,
116 end_addr: u64,
117 file_offset: u64,
118 module_path: &str,
119 expected_load_bias: u64,
120 ) {
121 let file_data = std::fs::read(module_path).expect("Failed to read test binary");
122 let object = object::File::parse(&file_data[..]).expect("Failed to parse test binary");
123 let load_bias =
124 elf_helper::compute_load_bias(&object, start_addr, end_addr, file_offset).unwrap();
125 println!("Load bias for {module_path}: 0x{load_bias:x}");
126 assert_eq!(
127 load_bias, expected_load_bias,
128 "Invalid load bias: {load_bias:x} != {expected_load_bias:x}"
129 );
130 }
131
132 // Note: You can double-check the values by getting the /proc/<pid>/maps via gdb:
133 // ```

Callers 5

test_golang_unwind_dataFunction · 0.85
test_cpp_unwind_dataFunction · 0.85
test_ruff_unwind_dataFunction · 0.85

Calls 2

compute_load_biasFunction · 0.85
readFunction · 0.50

Tested by 5

test_golang_unwind_dataFunction · 0.68
test_cpp_unwind_dataFunction · 0.68
test_ruff_unwind_dataFunction · 0.68