LIBTRACECMD(3)

πŸ’… LIBTRACECMD(3) β€” the libtrace-cmd girlies' manual

okay so bestie, welcome to the libtracefs manual page for libtracecmd(3) β€” yes the manual section is a little chaotic but we move. this page is literally all about one function and it's about to become your new fave πŸŽ€


✨ NAME ✨

tracecmd_set_loglevel β€” sets the log level of the library. that's it. that's the whole job. simple, iconic, ate πŸ’…


🌸 SYNOPSIS 🌸

#include <trace-cmd.h>

int tracecmd_set_loglevel(enum tep_loglevel level);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the tracecmd_set_loglevel() function sets the level of the library logs that get printed on the console. if you want the nitty-gritty deets on what each log level actually means, go look at libtraceevent(3) β€” it's giving read-the-source (jk it's a manpage, it's fine).

the way it works is kinda like a vibe check with a ladder: setting the log level to a specific value means logs from all the previous levels get printed too. so for example, TEP_LOG_WARNING will print any logs with severity TEP_LOG_WARNING, TEP_LOG_ERROR and TEP_LOG_CRITICAL. lowkey generous of it πŸ’–

the default log level is TEP_LOG_CRITICAL β€” that's the chill baseline, not too chatty, no cap.

and here's the cute part: when you set a new level, it also gets propagated to libtracefs and libtraceevent. so you set it once and everybody in the group chat hears about it 🫢


🌈 EXAMPLE 🌈

#include <trace-cmd.h>
...
tracecmd_set_loglevel(TEP_LOG_ALL);
...
/* call libtracecmd, libtracefs or libtraceevent APIs and observe any logs they produce */
...
tracecmd_set_loglevel(TEP_LOG_CRITICAL);

see the pattern? crank it all the way up, do your thing, then bring it back down to TEP_LOG_CRITICAL. main character energy, responsible girlie behaviour ✨


πŸŽ€ FILES πŸŽ€

  • trace-cmd.h β€” the header file to include in order to have access to the library APIs. literally the entry ticket to the party 🎟️
  • -ltracecmd β€” the linker switch to add when building a program that uses the library. don't forget it or the linker will simply not let you in 😭

πŸ‘‘ SEE ALSO πŸ‘‘

libtracefs(3), libtraceevent(3), trace-cmd(1), trace-cmd.dat(5)

iykyk, go read them all πŸ’€


🌸 AUTHOR 🌸

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

πŸ› REPORTING BUGS πŸ›

found a bug? report bugs to <linux-trace-devel@vger.kernel.org> β€” the girlies over there will handle it 🫢


πŸ’œ LICENSE πŸ’œ

libtracecmd is Free Software licensed under the GNU LGPL 2.1. slay, free as in freedom πŸ¦‹


⭐ RESOURCES ⭐

https://git.kernel.org/pub/scm/utils/trace-cmd/trace-cmd.git/

that's the repo, go touch grass (the source code, I mean) 🌱


πŸ“ COPYING πŸ“

Copyright (C) 2021 VMware, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL). iconic behaviour, ngl πŸ™ˆ


πŸ“ 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

these are literally just the emails as links, bestie, no extra lore πŸ’…


that's the whole page!! this was the libtracefs version dated 03/09/2026 for LIBTRACECMD(3) β€” go forth and log responsibly, mwah πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from