Some tools may have already a way to resolve the kernel functions. These APIs
allow them to keep using it instead of duplicating all the entries inside.
The tep_func_resolver_t type is the prototype of the alternative kernel
functions resolver. This function receives a pointer to its custom context
(set with the tep_set_function_resolver() call ) and the address of a kernel
function, which has to be resolved. In case of success, it should return
the name of the function and its module (if any) in modp.
The tep_set_function_resolver() function registers func as an alternative
kernel functions resolver. The tep argument is trace event parser context.
The priv argument is a custom context of the func function. The function
resolver is used by the APIs tep_find_function(),
tep_find_function_address(), and tep_print_func_field() to resolve
a function address to a function name.
The tep_reset_function_resolver() function resets the kernel functions
resolver to the default function. The tep argument is trace event parser
context.
These APIs can be used to find function name and start address, by given
address. The given address does not have to be exact, it will select
the function that would contain it.
The tep_find_function() function returns the function name, which contains the
given address addr. The tep argument is the trace event parser context.
The tep_find_function_address() function returns the function start address,
by given address addr. The addr does not have to be exact, it will select
the function that would contain it. The tep argument is the trace event
parser context.
The tep_register_function() function registers a function name mapped to an
address and (optional) module. This mapping is used in case the function tracer
or events have "%pS" parameter in its format string. It is common to pass in
the kallsyms function names with their corresponding addresses with this
function. The tep argument is the trace event parser context. The name is
the name of the function, the string is copied internally. The addr is the
start address of the function. The mod is the kernel module the function may
be in (NULL for none).
The tep_register_print_string() function registers a string by the address
it was stored in the kernel. Some strings internal to the kernel with static
address are passed to certain events. The "%s" in the event’s format field
which has an address needs to know what string would be at that address. The
tep_register_print_string() supplies the parsing with the mapping between kernel
addresses and those strings. The tep argument is the trace event parser
context. The fmt is the string to register, it is copied internally.
The addr is the address the string was located at.