BPF helper function metadata and utilities.
Helper metadata is loaded from resources/bpf-helpers.edn, which allows easy extension and customization without code changes.
Usage:
BPF helper function metadata and utilities. Helper metadata is loaded from resources/bpf-helpers.edn, which allows easy extension and customization without code changes. Usage: - (get-helper-info :map-lookup-elem) - Get metadata for a helper - (get-helper-id :ktime-get-ns) - Get helper function ID - (helpers-by-category :network) - Get all network helpers - (available-helpers :xdp "5.8") - Get helpers for program type and kernel
(all-helpers)Get all helpers including custom ones
Get all helpers including custom ones
(available-helpers prog-type)(available-helpers prog-type kernel-version)Get helpers compatible with program type and kernel version
Get helpers compatible with program type and kernel version
(clear-custom-helpers!)Remove all custom helpers
Remove all custom helpers
(get-helper-by-id id)Look up helper by numeric ID
Look up helper by numeric ID
(get-helper-by-name name)Look up helper by C function name
Look up helper by C function name
(get-helper-id helper-key)Get helper function ID by keyword
Get helper function ID by keyword
(get-helper-info helper-key)Get metadata for a helper function by keyword. Checks custom helpers first, then built-in helpers.
Get metadata for a helper function by keyword. Checks custom helpers first, then built-in helpers.
(helper-compatible? helper-key prog-type kernel-version)Check if helper is compatible with program type and kernel version
Check if helper is compatible with program type and kernel version
Complete registry of BPF helper functions with metadata. Loaded from resources/bpf-helpers.edn at runtime.
Complete registry of BPF helper functions with metadata. Loaded from resources/bpf-helpers.edn at runtime.
(helper-stats)Get statistics about available helpers
Get statistics about available helpers
(helpers-by-category category)Get all helpers in a category
Get all helpers in a category
(helpers-since-kernel kernel-version)Get helpers introduced in or after a specific kernel version
Get helpers introduced in or after a specific kernel version
(helpers-until-kernel kernel-version)Get helpers available up to a specific kernel version
Get helpers available up to a specific kernel version
(list-categories)List all helper categories
List all helper categories
(list-helpers)(list-helpers category)List all helpers, optionally filtered by category
List all helpers, optionally filtered by category
(list-helpers-for-program prog-type kernel-version)List helpers available for a specific program type and kernel version
List helpers available for a specific program type and kernel version
(print-helper-info helper-key)Print formatted helper information
Print formatted helper information
(print-helper-stats)Print helper statistics
Print helper statistics
(register-custom-helper! helper-key helper-info)Register a custom helper function.
Example: (register-custom-helper! :my-helper {:id 1000 :name "my_custom_helper" :signature {:return :long :args [:ctx-ptr :arg1]} :min-kernel "5.15" :prog-types :all :category :custom :description "My custom helper function"})
Register a custom helper function.
Example:
(register-custom-helper! :my-helper
{:id 1000
:name "my_custom_helper"
:signature {:return :long :args [:ctx-ptr :arg1]}
:min-kernel "5.15"
:prog-types :all
:category :custom
:description "My custom helper function"})(reload-helpers!)Reload helper metadata from resource file. Useful for development or after adding custom helpers.
Reload helper metadata from resource file. Useful for development or after adding custom helpers.
(search-helpers query)Search helpers by name or description. Returns helpers where query matches name or description (case-insensitive).
Search helpers by name or description. Returns helpers where query matches name or description (case-insensitive).
(unregister-custom-helper! helper-key)Remove a custom helper
Remove a custom helper
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |