Browse Source

test: add some #[track_caller] annotations

Tamir Duberstein 1 year ago
parent
commit
571c38b1c6

+ 1 - 0
test/integration-test/src/tests/bpf_probe_read.rs

@@ -93,6 +93,7 @@ fn set_kernel_buffer_element(bpf: &mut Bpf, bytes: &[u8]) {
     m.set(0, bytes, 0).unwrap();
 }
 
+#[track_caller]
 fn result_bytes(bpf: &Bpf) -> Vec<u8> {
     let m = Array::<_, TestResult>::try_from(bpf.map("RESULT").unwrap()).unwrap();
     let result = m.get(&0, 0).unwrap();

+ 1 - 0
test/integration-test/src/tests/rbpf.rs

@@ -107,6 +107,7 @@ fn use_map_with_rbpf() {
     }
 }
 
+#[track_caller]
 fn bpf_map_update_elem_multimap(map: u64, key: u64, value: u64, _: u64, _: u64) -> u64 {
     assert_matches!(map, 0xCAFE00 | 0xCAFE01);
     let key = *unsafe { (key as usize as *const u32).as_ref().unwrap() };