LIBTRACEEVENT(3)
π LIBTRACEEVENT π
okay bestie, so this is the manual for libtraceevent β yes, the same library fam as libtraceevent(3), but this page is about exactly one little function that's lowkey a lifesaver. iykyk. π¦
β¨ NAME β¨
tep_strerror β turns a regular errno or a tep error number into a cute lil' string that actually tells you what went wrong. π
πΈ SYNOPSIS πΈ
#include <event-parse.h>
int tep_strerror(struct tep_handle *tep, enum tep_errno errnum, char *buf, size_t buflen);
π DESCRIPTION π
so tep_strerror() takes a tep error number and converts it into a human readable string, no cap. like it's giving translator energy. π
- the
tepargument is your trace event parser context. - the
errnumis either a regularerrno(the one defined inerrno.h) or a tep error number. - the string that describes that error number gets copied into the
bufargument. - the
buflenargument is the size of thatbuf.
it's a thread safe wrapper around strerror_r(), periodt. and listen β that library function is messy fr fr, because it has two different behaviors: one POSIX and one GNU specific. but the tep_strerror() API always behaves like the POSIX version, meaning the error string gets copied into the user supplied buffer. every single time. slay. β¨
π RETURN VALUE π
tep_strerror() returns 0 if a valid errnum is passed in and the string gets copied into buf. π
if errnum is not a valid error number, it returns -1 and β important β buf is not modified. so don't go reading stale bytes from it, bestie. π
π§ EXAMPLE π§
#include <event-parse.h>
...
struct tep_handle *tep = tep_alloc();
...
char buf[32];
char *pool = calloc(1, 128);
if (tep == NULL) {
tep_strerror(tep, TEP_ERRNO__MEM_ALLOC_FAILED, buf, 32);
printf ("The pool is not initialized, %s", buf);
}
...
π FILES π
event-parse.hβ the header file you gotta include to have access to the library APIs. π«Ά-ltraceeventβ the linker switch to add when you're building a program that uses the library. literally just slap it on there. β¨
π SEE ALSO π
β 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? not fun but okay β report bugs to <linux-trace-devel@vger.kernel.org[3]> and the maintainers will handle it. π
π LICENSE π
libtraceevent is Free Software licensed under the GNU LGPL 2.1. π«Ά
π¦ RESOURCES π¦
https://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
π§΅ 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, go forth and handle your errors gracefully π
sign-off: this was libtraceevent 1.9.0, dated 06/15/2026 β see you in the next LIBTRACEEVENT(3) bestie, 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