From c725b9d69e9db663191171b344068ecc151db764 Mon Sep 17 00:00:00 2001 From: martinsoees Date: Thu, 13 Jun 2024 08:27:19 -0400 Subject: [PATCH] All tests are passing now --- aya-obj/src/lib.rs | 3 ++- aya/src/bpf.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/aya-obj/src/lib.rs b/aya-obj/src/lib.rs index ea0e5670..d0e27601 100644 --- a/aya-obj/src/lib.rs +++ b/aya-obj/src/lib.rs @@ -39,10 +39,11 @@ //! // Relocate the programs //! #[cfg(feature = "std")] //! let text_sections = std::collections::HashSet::new(); +//! let deactivate_maps = std::collections::HashMap::new(); //! #[cfg(not(feature = "std"))] //! let text_sections = hashbrown::HashSet::new(); //! object.relocate_calls(&text_sections).unwrap(); -//! object.relocate_maps(std::iter::empty(), &text_sections).unwrap(); +//! object.relocate_maps(std::iter::empty(), &text_sections, &deactivate_maps).unwrap(); //! //! // Run with rbpf //! let function = object.functions.get(&object.programs["prog_name"].function_key()).unwrap(); diff --git a/aya/src/bpf.rs b/aya/src/bpf.rs index 75e47f24..1c5db58d 100644 --- a/aya/src/bpf.rs +++ b/aya/src/bpf.rs @@ -238,11 +238,12 @@ impl<'a> EbpfLoader<'a> { /// ```no_run /// use aya::EbpfLoader; /// use aya_obj::generated::bpf_map_type; + /// use std::collections::HashSet; /// /// let mut set = HashSet::new(); /// set.insert(bpf_map_type::BPF_MAP_TYPE_RINGBUF); /// let ebpf = EbpfLoader::new() - /// .disable_maps(set) + /// .deactivate_maps(set) /// .load_file("file.o")?; /// # Ok::<(), aya::EbpfError>(()) /// ```