LIBTRACEEVENT(3)

πŸ’– LIBTRACEEVENT β€” the flags era πŸ’–

ok so bestie, this is the libtraceevent manual page, and today we're talking about tep_set_flag, tep_clear_flag and tep_test_flag β€” the trio that manages all the flags of your trace event parser context. it's giving switchboard operator energy and honestly? we're obsessed. 🌈


✨ NAME ✨

tep_set_flag, tep_clear_flag, tep_test_flag β€” Manage flags of trace event parser context. yes, that's the whole job. and they SLAY at it. πŸ’…


🌸 SYNOPSIS 🌸

#include <event-parse.h>

enum tep_flag {
        TEP_NSEC_OUTPUT,
        TEP_DISABLE_SYS_PLUGINS,
        TEP_DISABLE_PLUGINS
};
void tep_set_flag(struct tep_handle *tep, enum tep_flag flag);
void tep_clear_flag(struct tep_handle *tep, enum tep_flag flag);
bool tep_test_flag(struct tep_handle *tep, enum tep_flag flag);

look at that. three little functions. infinite potential. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the trace event parser context flags all live in enum tep_flag, and here's the full rundown because we do not gatekeep:

  • TEP_NSEC_OUTPUT β€” print event's timestamp in nano seconds, instead of micro seconds. tiny numbers, big flex. ⏱️
  • TEP_DISABLE_SYS_PLUGINS β€” disable plugins, located in system's plugin directory. this directory is defined at library compile time, and usually depends on library installation prefix: (install_preffix)/lib/traceevent/plugins. (yes, that spelling in the path is exactly how it's written, don't come for me. πŸ™ˆ)
  • TEP_DISABLE_PLUGINS β€” disable all library plugins. every last one:
    • in system's plugin directory
    • in directory, defined by the environment variable TRACEEVENT_PLUGIN_DIR
    • in user's home directory, ~/.traceevent/plugins
⚠️ Note: plugin related flags must me set before calling tep_load_plugins() API. (that "me" is the original's typo, bestie, i'm just the messenger β€” but the meaning is LOUD and CLEAR: set these flags FIRST.)

and now the three icons themselves:

  • tep_set_flag() sets flag to tep context. πŸŽ€
  • tep_clear_flag() clears flag from tep context. 🧹
  • tep_test_flag() tests if flag is set to tep context. πŸ”

πŸ”₯ RETURN VALUE πŸ”₯

tep_test_flag() returns true if flag is set, false otherwise. that's it. binary. no nuance. very main character. πŸ‘‘


πŸ’œ EXAMPLE πŸ’œ

here's the whole vibe in code, straight up, exactly as written:

#include <event-parse.h>
...
struct tep_handle *tep = tep_alloc();
...
/* Print timestamps in nanoseconds */
tep_set_flag(tep,  TEP_NSEC_OUTPUT);
...
if (tep_test_flag(tep, TEP_NSEC_OUTPUT)) {
        /* print timestamps in nanoseconds */
} else {
        /* print timestamps in microseconds */
}
...
/* Print timestamps in microseconds */
tep_clear_flag(tep, TEP_NSEC_OUTPUT);
...

set it, check it, clear it, repeat. that's the whole arc. 🫢


πŸŽ€ FILES πŸŽ€

  • event-parse.h β€” Header file to include in order to have access to the library APIs.
  • -ltraceevent β€” Linker switch to add when building a program that uses the library.

⭐ SEE ALSO ⭐

libtraceevent(3), trace-cmd(1)

go read those too, bestie, knowledge is free and it's cute. πŸ“š


πŸ‘‘ AUTHOR πŸ‘‘

  • Steven Rostedt <rostedt@goodmis.org[1]>, author of libtraceevent.
  • Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>, author of this man page.

legends, both of them, no cap. 🌟


😭 REPORTING BUGS 😭

Report bugs to <linux-trace-devel@vger.kernel.org[3]>

(be nice about it, they're doing their best, and their best is honestly iconic. πŸ’–)


🌈 LICENSE 🌈

libtraceevent is Free Software licensed under the GNU LGPL 2.1


πŸ“ RESOURCES πŸ“

https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/


🧚 NOTES 🧚

  1. rostedt@goodmis.org β€” mailto:rostedt@goodmis.org
  2. tz.stoyanov@gmail.com β€” mailto:tz.stoyanov@gmail.com
  3. linux-trace-devel@vger.kernel.org β€” mailto:linux-trace-devel@vger.kernel.org

and that's the page, babes πŸ’• this was libtraceevent 1.9.0, from the libtraceevent Manual, dated 06/15/2026 β€” go set some flags, you absolute icon. periodt. πŸ’…βœ¨

πŸ“¦ where this page comes from