LIBTRACEEVENT(3)

πŸ¦‹ LIBTRACEEVENT(3) β€” libtraceevent Manual πŸ¦‹

okay bestie, so this is a page from the libtraceevent manual. sit down, sip ur drink, we're gonna talk about CPUs and their tracing buffers πŸ’…


✨ NAME ✨

tep_get_cpus, tep_set_cpus β€” get / set the number of CPUs that have a tracing buffer representing them. and before u get any ideas: the buffer may be empty. like, it exists, it's there, it's just not giving content, yk? 🫢


✨ SYNOPSIS ✨

#include <event-parse.h>

int tep_get_cpus(struct tep_handle *tep);
void tep_set_cpus(struct tep_handle *tep, int cpus);

✨ DESCRIPTION ✨

so, tep_get_cpus() does exactly what it says on the tin β€” it gets the number of CPUs that have a tracing buffer representing them. the tep argument is ur trace event parser context. that's the whole vibe.

and tep_set_cpus() sets that number. tep is, again, the trace event parser context, and cpu is the number of CPUs with tracing data. classic setter/gutter situation, we love a matched pair πŸŽ€


✨ RETURN VALUE ✨

tep_get_cpus() returns the number of CPUs that have tracing data recorded. that's it. that's the number. no cap. πŸ’–


✨ EXAMPLE ✨

ngl this is the cutest lil snippet, look:

#include <event-parse.h>
...
struct tep_handle *tep = tep_alloc();
...
        tep_set_cpus(tep, 5);
...
        printf("We have tracing data for %d CPUs", tep_get_cpus(tep));

see how she allocates, sets 5, then asks for it back? main character energy fr fr πŸ‘‘


✨ FILES ✨

  • event-parse.h β€” the header file u gotta include to get access to the library APIs. gatekeeping is over, include her πŸ¦‹
  • -ltraceevent β€” the linker switch to add when building a program that uses the library. do not forget her or she WILL ghost u 😭

✨ SEE ALSO ✨


✨ AUTHOR ✨

  • Steven Rostedt <rostedt@goodmis.org[1]>, author of libtraceevent. legend behaviour.
  • Tzvetomir Stoyanov <tz.stoyanov@gmail.com[2]>, author of this man page. also legendary.

✨ REPORTING BUGS ✨

found a bug? don't suffer in silence bestie, report it to <linux-trace-devel@vger.kernel.org[3]> πŸ’Œ


✨ LICENSE ✨

libtraceevent is Free Software licensed under the GNU LGPL 2.1. periodt. 🌈


✨ RESOURCES ✨

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

go look, it's giving source code, it's giving community 🌸


✨ 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 babes πŸ’œ this was libtraceevent 1.9.0, dated 06/15/2026 β€” iykyk. stay tracing, stay iconic, and remember: the buffer may be empty but ur potential never is πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from