LIBTRACEEVENT(3)
π LIBTRACEEVENT(3) π
okay bestie, welcome to the libtraceevent manual β¨ you're in the right place, this is where the lore lives π«Ά
πΈ NAME πΈ
tep_find_function, tep_find_function_address, tep_find_function_info β the trio that goes "hey, what function is at this address, and where does it start?" π
β¨ SYNOPSIS β¨
#include <event-parse.h>
const char *tep_find_function(struct tep_handle *tep, unsigned long long addr);
unsigned long long tep_find_function_address(struct tep_handle *tep, unsigned long long addr);
int tep_find_function_info(struct tep_handle *tep, unsigned long long addr, const char **name,
unsigned long long *start, unsigned long *size);
π DESCRIPTION π
so like, these functions are your little address detectives π΅οΈβοΈ you hand them an address, and they find the function name and the start address for you. and here's the cute part β the address you give does NOT have to be exact. it'll just pick the function that would contain it. no precision anxiety needed, she's flexible π
tep_find_function() gives you back the function name, the one that contains the address addr you passed in. the tep argument is the trace event parser context, keep that close, she's important.
tep_find_function_address() gives you back the function's start address, based on the address addr you gave it. and again β addr doesn't need to be exact, it selects whatever function would contain it. tep is the trace event parser context, same as always π«Ά
tep_find_function_info() gets you the name, the starting address (start), and the function text size of the function at that address β but only if it's found. β οΈ lil heads up: if the tep handle has a function resolver (that's the one perf uses), then size gets set to zero. not a bug, just how it is, iykyk.
π¦ RETURN VALUE π¦
tep_find_function()β returns the function name, orNULLif it can't be found πtep_find_function_address()β returns the function start address, or0if it can't be found πtep_find_function_info()β returns1if a function is found for that address, or0if it's not β¨
π EXAMPLE π
here's how it looks in the wild, fr fr:
#include <event-parse.h>
...
struct tep_handle *tep = tep_alloc();
...
void show_function_name(unsigned long long addr)
{
const char *fname = tep_find_function(tep, addr);
if (fname)
printf("Found function %s at 0x%0llx\n", fname, addr);
else
printf("No function found at 0x%0llx\n", addr);
}
void show_function_start_addr(unsigned long long addr)
{
const char *fname = tep_find_function(tep, addr);
unsigned long long fstart;
if (!fname) {
printf("No function found at 0x%0llx\n", addr);
return;
}
fstart = tep_find_function_address(tep, addr);
printf("Function %s at 0x%llx starts at 0x%0llx\n",
fname, addr, fstart);
}
void show_function_info(unsigned long long addr)
{
const char *fname;
unsigned long long fstart;
unsigned long size;
ret = tep_find_function_info(tep, addr, &fname, &fstart, &size);
if (!ret) {
printf("No function found at 0x%0lx\n", addr);
return;
}
printf("Function %s at 0x%lx starts at 0x%0lx and is %ld in size\n",
fname, addr, fstart, size);
}
...
π FILES π
event-parse.hβ the header file you include so you can actually touch the library APIs π-ltraceeventβ the linker switch you add when building a program that uses this library π
π SEE ALSO π
libtraceevent(3), trace-cmd(1)
π AUTHOR π
- Steven Rostedt <rostedt@goodmis.org[1]>, author of libtraceevent. absolute icon π
- Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>, author of this man page. thank you for your service π«‘
π€ REPORTING BUGS π€
found a bug? don't suffer in silence bestie, report it to <linux-trace-devel@vger.kernel.org[3]> π¬
β LICENSE β
libtraceevent is Free Software licensed under the GNU LGPL 2.1 β free as in freedom, periodt π
π§ RESOURCES π§
https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
π NOTES π
- rostedt@goodmis.org mailto:rostedt@goodmis.org
- tz.stoyanov@gmail.com mailto:tz.stoyanov@gmail.com
- linux-trace-devel@vger.kernel.org mailto:linux-trace-devel@vger.kernel.org
and that's the whole vibe check β
this was libtraceevent 1.9.0, dated 06/15/2026, and you've been reading the LIBTRACEEVENT(3) page the whole time π ily, go find some functions πβ¨
π¦ where this page comes from
- ubuntu stonking: libtraceevent-doc 1:1.9.0-2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms