LIBTRACEEVENT(3)

πŸ’– LIBTRACEEVENT(3) β€” the libtraceevent manual, bestie edition πŸ’–

okay so welcome to the libtraceevent manual page, and today we're hyperfixating on endianness, which sounds boring but is literally the difference between your raw data making sense and your raw data being a cursed scrambled mess 🫠


✨ NAME ✨

tep_is_file_bigendian, tep_set_file_bigendian β€” get / set the endianness of the raw data being accessed by the tep handler πŸ’…


✨ SYNOPSIS ✨

#include <event-parse.h>

enum tep_endian {
        TEP_LITTLE_ENDIAN = 0,
        TEP_BIG_ENDIAN
};

bool tep_is_file_bigendian(struct tep_handle *tep);
void tep_set_file_bigendian(struct tep_handle *tep, enum tep_endian endian);

✨ DESCRIPTION ✨

tep_is_file_bigendian()

this one gets the endianness of the raw data that's being accessed by the tep handler, no cap πŸ‘€ the tep argument is the trace event parser context β€” that's your lil main character struct holding everything together πŸŽ€

tep_set_file_bigendian()

and this one sets the endianness of the raw data being accessed by the tep handler ✨ again, tep is the trace event parser context, same bestie as before.

the endian argument is the endianness, and it's giving two options:

  • TEP_LITTLE_ENDIAN β€” the raw data is in little endian format 🐣
  • TEP_BIG_ENDIAN β€” the raw data is in big endian format 🐘

✨ RETURN VALUE ✨

tep_is_file_bigendian() returns true if the data is in bigendian format, and false otherwise. simple as that, no plot twist 🌸


✨ EXAMPLE ✨

#include <event-parse.h>
...
struct tep_handle *tep = tep_alloc();
...
        tep_set_file_bigendian(tep, TEP_LITTLE_ENDIAN);
...
        if (tep_is_file_bigendian(tep)) {
                /* The raw data is in big endian */
        } else {
                /* The raw data is in little endian */
        }

✨ 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, they're iconic fr fr πŸ‘‘


✨ AUTHOR ✨

  • Steven Rostedt <rostedt@goodmis.org> β€” author of libtraceevent 🫢
  • Tzvetomir Stoyanov <tz.stoyanov@gmail.com> β€” author of this man page ✍️

✨ REPORTING BUGS ✨

found a bug? report it to <linux-trace-devel@vger.kernel.org> β€” they wanna know, seriously, don't gatekeep πŸ›


✨ LICENSE ✨

libtraceevent is Free Software licensed under the GNU LGPL 2.1 βš–οΈ


✨ RESOURCES ✨

https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/ β€” the source, go lurk 🧚


✨ 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 whole page bestie, every flag, every value, every default accounted for β€” nothing skipped, nothing invented πŸ’€βœ¨

libtraceevent 1.9.0 Β· dated 06/15/2026 🌈 slay, go parse some endianness, you got this πŸ‘‘πŸ’–

πŸ“¦ where this page comes from