package kallsyms

import "github.com/cilium/ebpf/internal/kallsyms"

Index

Functions

func Address

func Address(symbol string) (uint64, error)

Address returns the address of the given symbol in the kernel. Returns 0 and no error if the symbol is not present. Returns an error if multiple addresses were found for a symbol.

Consider AssignAddresses if you need to resolve multiple symbols, as it will only perform one iteration over /proc/kallsyms.

func AssignAddresses

func AssignAddresses(symbols map[string]uint64) error

AssignAddresses looks up the addresses of the requested symbols in the kernel and assigns them to their corresponding values in the symbols map. Results of all lookups are cached, successful or otherwise.

Any symbols missing in the kernel are ignored. Returns an error if multiple addresses were found for a symbol.

func AssignModules

func AssignModules(symbols map[string]string) error

AssignModules looks up the kernel module providing each given symbol, if any, and assigns them to their corresponding values in the symbols map. Only function symbols are considered. Results of all lookups are cached, successful or otherwise.

Any symbols missing in the kernel are ignored. Returns an error if multiple symbols with a given name were found.

func Module

func Module(name string) (string, error)

Module returns the kernel module providing the given symbol in the kernel, if any. Returns an empty string and no error if the symbol is not present in the kernel. Only function symbols are considered. Returns an error if multiple symbols with the same name were found.

Consider AssignModules if you need to resolve multiple symbols, as it will only perform one iteration over /proc/kallsyms.

Source Files

cache.go kallsyms.go reader.go

Version
v0.18.0 (latest)
Published
Apr 2, 2025
Platform
linux/amd64
Imports
13 packages
Last checked
1 week ago

Tools for package owners.