LIBTRACEEVENT(3)
π LIBTRACEEVENT β bestie edition πΈ
okay so this is libtraceevent, from the libtraceevent Manual, and today we're doing the little functions that justβ¦ print stuff. internal info. the receipts. the lore. π«Ά
β¨ NAME β¨
tep_print_printk, tep_print_funcs, tep_set_test_filters, tep_plugin_print_options β they print libtraceevent internal information. that's it, that's the job, and they ate π
β¨ SYNOPSIS β¨
#include <event-parse.h>
#include <trace-seq.h>
void tep_print_printk(struct tep_handle *tep);
void tep_print_funcs(struct tep_handle *tep);
void tep_set_test_filters(struct tep_handle *tep, int test_filters);
void tep_plugin_print_options(struct trace_seq *s);
look at her. four little functions. no cap, they're all void so they don't return anything, they just do the thing and leave π
β¨ DESCRIPTION β¨
okay bestie let me walk you through each one, one at a time, no skipping π
tep_print_printk() prints the printk string formats that were stored for this tracing session. the tep argument is your trace event parser context. so basically it's like "hey, show me all the printk format strings you've been keeping in your pocket" π
tep_print_funcs() prints the stored function name to address mapping for this tracing session. the tep argument is the trace event parser context. it's giving phonebook but for functions πβ¨
tep_set_test_filters() sets a flag to test a filter string. and here's the plot twist: if this flag is set, when tep_filter_add_filter_str() API as called, it will print the filter string instead of adding it. so it's a vibe check on your filter before it actually commits, iykyk π«£ the tep argument is the trace event parser context. the test_filters argument is the test flag that will be set.
tep_plugin_print_options() writes a list of the registered plugin options into s. that's the whole thing. short queen. π
β¨ EXAMPLE β¨
here's what it looks like in the wild, literally:
#include <event-parse.h>
#include <trace-seq.h>
...
struct tep_handle *tep = tep_alloc();
...
tep_print_printk(tep);
...
tep_print_funcs(tep);
...
struct tep_event_filter *filter = tep_filter_alloc(tep);
tep_set_test_filters(tep, 1);
tep_filter_add_filter_str(filter, "sched/sched_wakeup:target_cpu==1");
tep_set_test_filters(tep, 0);
tep_filter_free(filter);
...
struct trace_seq seq;
trace_seq_init(&seq);
tep_plugin_print_options(&s);
...
see how it turns the test flag on (1), adds the filter, then turns it back off (0) and frees the filter? that's the whole little dance π©° and yes, the last call says &s, that's literally what's written, don't come for me, I copy exactly π
β¨ FILES β¨
event-parse.hβ the header file you include so you can actually touch the library APIs. no include, no access, that's the rule π-ltraceeventβ the linker switch you add when building a program that uses the library. link her or you can't call her β¨
β¨ SEE ALSO β¨
go read those too, be a well-rounded icon π
β¨ AUTHOR β¨
- Steven Rostedt
<rostedt@goodmis.org[1]>, author of libtraceevent. π - Tzvetomir Stoyanov
<tz.stoyanov@gmail.com[2]>, author of this man page. πΈ
β¨ REPORTING BUGS β¨
found a bug? don't be shy, report it, that's self care:
Report bugs to <linux-trace-devel@vger.kernel.org[3]> ππ«Ά
β¨ LICENSE β¨
libtraceevent is Free Software licensed under the GNU LGPL 2.1. periodt. π
β¨ RESOURCES β¨
https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
clone it, read it, stan it π§
β¨ NOTES β¨
rostedt@goodmis.orgmailto:rostedt@goodmis.orgtz.stoyanov@gmail.commailto:tz.stoyanov@gmail.comlinux-trace-devel@vger.kernel.orgmailto:linux-trace-devel@vger.kernel.org
and that's the whole page bestie π this was libtraceevent, version 1.9.0, dated 06/15/2026, written by the libtraceevent crew, and honestly? iconic. go print some internal information, you deserve it. mwah π πβ¨π
π¦ 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