Liking cljdoc? Tell your friends :D

clj-ebpf.btf

BTF (BPF Type Format) parsing and type introspection

BTF (BPF Type Format) parsing and type introspection
raw docstring

btf-available?clj

(btf-available?)

Check if BTF is available on this system.

Returns true if /sys/kernel/btf/vmlinux exists and is readable.

Example: (btf-available?) => true

Check if BTF is available on this system.

Returns true if /sys/kernel/btf/vmlinux exists and is readable.

Example:
  (btf-available?) => true
sourceraw docstring

btf-func-linkageclj

Function linkage types

Function linkage types
sourceraw docstring

btf-int-encodingclj

INT type encoding flags

INT type encoding flags
sourceraw docstring

btf-kindclj

BTF type kinds (19 types)

BTF type kinds (19 types)
sourceraw docstring

btf-kind-num->keywordclj

Reverse map: kind number to keyword

Reverse map: kind number to keyword
sourceraw docstring

btf-magicclj

source

btf-var-linkageclj

Variable linkage types

Variable linkage types
sourceraw docstring

btf-versionclj

source

find-functionclj

(find-function btf name)

Find a function by name.

Parameters:

  • btf: BTF data (from load-btf-file)
  • name: Function name

Returns function type information or nil.

Example: (find-function btf "sys_read")

Find a function by name.

Parameters:
- btf: BTF data (from load-btf-file)
- name: Function name

Returns function type information or nil.

Example:
  (find-function btf "sys_read")
sourceraw docstring

find-type-by-nameclj

(find-type-by-name btf name)

Find type by name.

Parameters:

  • btf: BTF data (from load-btf-file)
  • name: Type name to search for

Returns type information or nil if not found.

Example: (find-type-by-name btf "task_struct")

Find type by name.

Parameters:
- btf: BTF data (from load-btf-file)
- name: Type name to search for

Returns type information or nil if not found.

Example:
  (find-type-by-name btf "task_struct")
sourceraw docstring

get-enum-valuesclj

(get-enum-values btf type-info)

Get enum values with names.

Parameters:

  • btf: BTF data (from load-btf-file)
  • type-info: Enum type information

Returns vector of enum values with :name added.

Example: (get-enum-values btf enum-type)

Get enum values with names.

Parameters:
- btf: BTF data (from load-btf-file)
- type-info: Enum type information

Returns vector of enum values with :name added.

Example:
  (get-enum-values btf enum-type)
sourceraw docstring

get-func-paramsclj

(get-func-params btf type-info)

Get function parameters with names.

Parameters:

  • btf: BTF data (from load-btf-file)
  • type-info: Function prototype type information

Returns vector of parameters with :name added.

Example: (get-func-params btf func-proto-type)

Get function parameters with names.

Parameters:
- btf: BTF data (from load-btf-file)
- type-info: Function prototype type information

Returns vector of parameters with :name added.

Example:
  (get-func-params btf func-proto-type)
sourceraw docstring

get-function-signatureclj

(get-function-signature btf func-type)

Get function signature with return type and parameter names/types.

Parameters:

  • btf: BTF data (from load-btf-file)
  • func-type: Function type information

Returns map with :return-type, :params.

Example: (get-function-signature btf func-type)

Get function signature with return type and parameter names/types.

Parameters:
- btf: BTF data (from load-btf-file)
- func-type: Function type information

Returns map with :return-type, :params.

Example:
  (get-function-signature btf func-type)
sourceraw docstring

get-struct-membersclj

(get-struct-members btf type-info)

Get struct or union members with names.

Parameters:

  • btf: BTF data (from load-btf-file)
  • type-info: Struct/union type information

Returns vector of members with :name added.

Example: (get-struct-members btf struct-type)

Get struct or union members with names.

Parameters:
- btf: BTF data (from load-btf-file)
- type-info: Struct/union type information

Returns vector of members with :name added.

Example:
  (get-struct-members btf struct-type)
sourceraw docstring

get-type-by-idclj

(get-type-by-id btf type-id)

Get type information by type ID.

Parameters:

  • btf: BTF data (from load-btf-file)
  • type-id: Type ID to look up

Returns type information or nil if not found.

Example: (get-type-by-id btf 42)

Get type information by type ID.

Parameters:
- btf: BTF data (from load-btf-file)
- type-id: Type ID to look up

Returns type information or nil if not found.

Example:
  (get-type-by-id btf 42)
sourceraw docstring

get-type-nameclj

(get-type-name btf type-info)

Get the name of a type.

Parameters:

  • btf: BTF data (from load-btf-file)
  • type-info: Type information (from get-type-by-id)

Returns the type name string or nil.

Example: (get-type-name btf type-info)

Get the name of a type.

Parameters:
- btf: BTF data (from load-btf-file)
- type-info: Type information (from get-type-by-id)

Returns the type name string or nil.

Example:
  (get-type-name btf type-info)
sourceraw docstring

get-type-sizeclj

(get-type-size btf type-id)

Get the size of a type in bytes.

Parameters:

  • btf: BTF data (from load-btf-file)
  • type-id: Type ID

Returns size in bytes or nil if size is not defined.

Example: (get-type-size btf type-id)

Get the size of a type in bytes.

Parameters:
- btf: BTF data (from load-btf-file)
- type-id: Type ID

Returns size in bytes or nil if size is not defined.

Example:
  (get-type-size btf type-id)
sourceraw docstring

list-typesclj

(list-types btf kind)

List all types of a specific kind.

Parameters:

  • btf: BTF data (from load-btf-file)
  • kind: Type kind keyword (e.g., :struct, :func, :typedef)

Returns vector of matching types.

Example: (list-types btf :struct) (list-types btf :func)

List all types of a specific kind.

Parameters:
- btf: BTF data (from load-btf-file)
- kind: Type kind keyword (e.g., :struct, :func, :typedef)

Returns vector of matching types.

Example:
  (list-types btf :struct)
  (list-types btf :func)
sourceraw docstring

load-btf-fileclj

(load-btf-file)
(load-btf-file path)

Load and parse a BTF file.

Parameters:

  • path: Path to BTF file (default: /sys/kernel/btf/vmlinux)

Returns a map with:

  • :header - BTF header information
  • :strings - String section lookup map
  • :types - Vector of types indexed by type ID

Example: (load-btf-file) (load-btf-file "/sys/kernel/btf/vmlinux")

Load and parse a BTF file.

Parameters:
- path: Path to BTF file (default: /sys/kernel/btf/vmlinux)

Returns a map with:
- :header - BTF header information
- :strings - String section lookup map
- :types - Vector of types indexed by type ID

Example:
  (load-btf-file)
  (load-btf-file "/sys/kernel/btf/vmlinux")
sourceraw docstring

resolve-typeclj

(resolve-type btf type-id)

Resolve a type through typedef/const/volatile/restrict indirections.

Parameters:

  • btf: BTF data (from load-btf-file)
  • type-id: Type ID to resolve

Returns the resolved type ID (may be the same if not an indirection).

Example: (resolve-type btf typedef-id)

Resolve a type through typedef/const/volatile/restrict indirections.

Parameters:
- btf: BTF data (from load-btf-file)
- type-id: Type ID to resolve

Returns the resolved type ID (may be the same if not an indirection).

Example:
  (resolve-type btf typedef-id)
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close