From 571c38b1c6f8bdac3acb6a37417e4c2a4ad060cb Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 1 Aug 2023 11:08:09 -0400 Subject: [PATCH] test: add some #[track_caller] annotations --- test/integration-test/src/tests/bpf_probe_read.rs | 1 + test/integration-test/src/tests/rbpf.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/test/integration-test/src/tests/bpf_probe_read.rs b/test/integration-test/src/tests/bpf_probe_read.rs index b2ceb6d1..bf91f271 100644 --- a/test/integration-test/src/tests/bpf_probe_read.rs +++ b/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 { let m = Array::<_, TestResult>::try_from(bpf.map("RESULT").unwrap()).unwrap(); let result = m.get(&0, 0).unwrap(); diff --git a/test/integration-test/src/tests/rbpf.rs b/test/integration-test/src/tests/rbpf.rs index 1d906ba7..4e5314c3 100644 --- a/test/integration-test/src/tests/rbpf.rs +++ b/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() };