pub struct BpfSkeleton { /* private fields */ }
Expand description
Represents a polling-ready bpf skeleton. With you can control the ebpf program and poll from it.
Implementations§
Source§impl BpfSkeleton
impl BpfSkeleton
Sourcepub fn create_poll_handle(&self) -> PollingHandle
pub fn create_poll_handle(&self) -> PollingHandle
Create a poll handle to control the poll progress You can create multiple ones. All handles have the same ability
Sourcepub fn get_program_name(&self) -> &str
pub fn get_program_name(&self) -> &str
Get the name of the loaded program
Sourcepub fn get_map_fd(&self, name: impl AsRef<str>) -> Option<i32>
pub fn get_map_fd(&self, name: impl AsRef<str>) -> Option<i32>
Get the fd of the provided map returns None if not found
Sourcepub fn get_prog_fd(&self, name: impl AsRef<str>) -> Option<i32>
pub fn get_prog_fd(&self, name: impl AsRef<str>) -> Option<i32>
Get the fd of the provided program returns None if not found
Sourcepub fn wait_and_poll_to_handler_with_multiple_exporter(
&self,
exporter_provider: impl Fn(&str) -> Option<(ExportFormatType, Arc<dyn EventHandler>, Option<Arc<dyn Any>>)>,
) -> Result<()>
pub fn wait_and_poll_to_handler_with_multiple_exporter( &self, exporter_provider: impl Fn(&str) -> Option<(ExportFormatType, Arc<dyn EventHandler>, Option<Arc<dyn Any>>)>, ) -> Result<()>
Start poll with each map corresponding to a different exporter
The function exporter_provider
should return the ExportFormatType, EventHandler, and UserContext(if applies) for the given map name (If you want to set the exporter)
Sourcepub fn wait_and_poll_to_handler(
&self,
export_format_type: ExportFormatType,
export_event_handler: Option<Arc<dyn EventHandler>>,
user_context: Option<Arc<dyn Any>>,
) -> Result<()>
pub fn wait_and_poll_to_handler( &self, export_format_type: ExportFormatType, export_event_handler: Option<Arc<dyn EventHandler>>, user_context: Option<Arc<dyn Any>>, ) -> Result<()>
@brief auto polling and export the data to user space handler
@details The key of the value is the field name in the export json.
This function will block the current thread and poll
If you want to control the poller, just create a handle using create_poll_handle
before calling this.
Note: this function will set paused and terminating to false before polling.