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 π
rostedt@goodmis.orgβmailto:rostedt@goodmis.orgtz.stoyanov@gmail.comβmailto:tz.stoyanov@gmail.comlinux-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
- arch rolling: trace-cmd 3.4-1 Β· GPL-2.0-only AND LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms