LIBTRACEFS(3)

πŸ’… LIBTRACEFS(3) β€” the libtracefs manual, bestie edition πŸ¦‹

okay so this is a page from the libtracefs manual, and we're about to make the library's log levels make sense. no cap. ✨


🌸 NAME 🌸

tracefs_set_loglevel β€” sets the log level of the library, that's literally the whole job πŸ’…


⭐ SYNOPSIS ⭐

#include <tracefs.h>

int tracefs_set_loglevel(enum tep_loglevel level);

πŸŽ€ DESCRIPTION πŸŽ€

okay so tracefs_set_loglevel() sets the level of the library logs that get printed on the console. πŸ“œ See libtraceevent(3) for the detailed description of the log levels β€” that's where the lore lives, iykyk.

here's the important part: setting the log level to a specific value means logs from the previous levels get printed too. so it's cumulative, not picky. πŸ™ˆ for example, TEP_LOG_WARNING will print any logs with severity TEP_LOG_WARNING, TEP_LOG_ERROR and TEP_LOG_CRITICAL. it's giving "come one, come all."

the default log level is TEP_LOG_CRITICAL πŸ‘‘

and when a new level is set, it is also propagated to the libtraceevent. so the vibe travels. πŸ¦‹


πŸ”₯ EXAMPLE πŸ”₯

#include <tracefs.h>

tracefs_set_loglevel(TEP_LOG_ALL);
...
/* call libtracefs or libtraceevent APIs and observe any logs they produce */
...
tracefs_set_loglevel(TEP_LOG_CRITICAL);

look at her go β€” turn the logs all the way up with TEP_LOG_ALL, do your thing, then tuck it back to TEP_LOG_CRITICAL. iconic behavior. πŸ’–


🧚 FILES 🧚

  • tracefs.h β€” header file to include in order to have access to the library APIs. yes you actually have to #include it, bestie. 🫢
  • -ltracefs β€” linker switch to add when building a program that uses the library. don't forget her, she's the whole reason it links. πŸ”—

🌈 SEE ALSO 🌈

libtracefs(3), libtraceevent(3), trace-cmd(1)


πŸ‘‘ AUTHOR πŸ‘‘

  • Steven Rostedt <rostedt@goodmis.org[1]>
  • Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>

πŸ’€ REPORTING BUGS πŸ’€

report bugs to <linux-trace-devel@vger.kernel.org[3]> β€” they wanna hear it, fr fr. πŸ›


🌸 LICENSE 🌸

libtracefs is Free Software licensed under the GNU LGPL 2.1 πŸ“œ


πŸ¦‹ RESOURCES πŸ¦‹

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


⭐ COPYING ⭐

Copyright (C) 2021 VMware, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL).


πŸ“ 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 🫢 this was libtracefs version 1.8.4, dated 10/21/2026 β€” go forth and set your log levels with main character energy πŸ’…βœ¨

πŸ“¦ where this page comes from