Skip to main content

Module helper

Module helper 

Source
Expand description

Basic eBPF helper functions module.

Modules§

consts
Helper function IDs for BPF programs.

Functions§

bpf_ktime_get_ns
Get the current kernel time in nanoseconds.
bpf_probe_read
For tracing programs, safely attempt to read size bytes from kernel space address unsafe_ptr and store the data in dst.
init_helper_functions
Initialize the helper functions map.
map_delete_elem
Delete entry with key from map.
map_for_each_elem
Do some action for each element in map.
map_lookup_elem
Lookup an element in map.
map_lookup_percpu_elem
Lookup an element in percpu map.
map_peek_elem
Get an element from map without removing it.
map_pop_elem
Pop an element from map.
map_push_elem
Push an element value in map.
map_update_elem
Update entry with key in map.
perf_event_output
Output data to a perf event.
printf
Printf according to the format string, function will return the number of bytes written(including ‘\0’)
probe_read_user_str
Copy a NULL terminated string from an unsafe user address unsafe_ptr to dst.
raw_map_delete_elem
Delete entry with key from map.
raw_map_for_each_elem
For each element in map, call callback_fn function with map, callback_ctx and other map-specific parameters. The callback_fn should be a static function and the callback_ctx should be a pointer to the stack. The flags is used to control certain aspects of the helper. Currently, the flags must be 0.
raw_map_lookup_elem
See https://ebpf-docs.dylanreimerink.nl/linux/helper-function/bpf_map_lookup_elem/
raw_map_lookup_percpu_elem
Perform a lookup in percpu map for an entry associated to key on cpu.
raw_map_peek_elem
Get an element from map without removing it.
raw_map_pop_elem
Pop an element from map.
raw_map_push_elem
Push an element value in map.
raw_map_update_elem
Update entry with key in map.
raw_perf_event_output
See https://ebpf-docs.dylanreimerink.nl/linux/helper-function/bpf_perf_event_output/
trace_printf
See https://ebpf-docs.dylanreimerink.nl/linux/helper-function/bpf_trace_printk/

Type Aliases§

RawBPFHelperFn
Type alias for a raw BPF helper function.