LIBTRACEFS(3)
π NAME π
hey bestie, welcome to LIBTRACEFS(3) β the libtracefs manual page, and it's giving "ftrace options explained by your favorite Unix-obsessed group chat" energy β¨
tracefs_options β ftrace options that can be controlled using the tracefs library π
πΈ SYNOPSIS πΈ
#include <tracefs.h>
enum tracefs_option_id {
TRACEFS_OPTION_INVALID,
TRACEFS_OPTION_ANNOTATE,
TRACEFS_OPTION_BIN,
TRACEFS_OPTION_BLK_CGNAME,
TRACEFS_OPTION_BLK_CGROUP,
TRACEFS_OPTION_BLK_CLASSIC,
TRACEFS_OPTION_BLOCK,
TRACEFS_OPTION_CONTEXT_INFO,
TRACEFS_OPTION_DISABLE_ON_FREE,
TRACEFS_OPTION_DISPLAY_GRAPH,
TRACEFS_OPTION_EVENT_FORK,
TRACEFS_OPTION_FGRAPH_ABSTIME,
TRACEFS_OPTION_FGRAPH_CPU,
TRACEFS_OPTION_FGRAPH_DURATION,
TRACEFS_OPTION_FGRAPH_IRQS,
TRACEFS_OPTION_FGRAPH_OVERHEAD,
TRACEFS_OPTION_FGRAPH_OVERRUN,
TRACEFS_OPTION_FGRAPH_PROC,
TRACEFS_OPTION_FGRAPH_TAIL,
TRACEFS_OPTION_FUNC_STACKTRACE,
TRACEFS_OPTION_FUNCTION_FORK,
TRACEFS_OPTION_FUNCTION_TRACE,
TRACEFS_OPTION_GRAPH_TIME,
TRACEFS_OPTION_HEX,
TRACEFS_OPTION_IRQ_INFO,
TRACEFS_OPTION_LATENCY_FORMAT,
TRACEFS_OPTION_MARKERS,
TRACEFS_OPTION_OVERWRITE,
TRACEFS_OPTION_PAUSE_ON_TRACE,
TRACEFS_OPTION_PRINTK_MSG_ONLY,
TRACEFS_OPTION_PRINT_PARENT,
TRACEFS_OPTION_RAW,
TRACEFS_OPTION_RECORD_CMD,
TRACEFS_OPTION_RECORD_TGID,
TRACEFS_OPTION_SLEEP_TIME,
TRACEFS_OPTION_STACKTRACE,
TRACEFS_OPTION_SYM_ADDR,
TRACEFS_OPTION_SYM_OFFSET,
TRACEFS_OPTION_SYM_USEROBJ,
TRACEFS_OPTION_TRACE_PRINTK,
TRACEFS_OPTION_USERSTACKTRACE,
TRACEFS_OPTION_VERBOSE,
};
π¦ DESCRIPTION π¦
okay so this enum is basically the whole roster of ftrace options that can be manipulated using the tracefs library π
want the deep lore on any specific option? it lives in Documentation/trace/ftrace.rst from the Linux kernel tree, in the trace_options section. no cap π
heads up, bestie: some ftrace options cannot be manipulated by this library, because they're intended for internal, debug purposes. these options control the tracers or the trace output. every option has two states β on and off β and the default state is different for each of them π
π Common options for all tracers π
TRACEFS_OPTION_INVALIDβ not a valid ftrace option; it's used by the API to indicate an error.TRACEFS_OPTION_ANNOTATEβ display when a new CPU buffer started.TRACEFS_OPTION_BINβ display the formats in raw binary.TRACEFS_OPTION_CONTEXT_INFOβ show only the event data. hides the comm, PID, timestamp, CPU, and other useful data.TRACEFS_OPTION_BLOCKβ when set, readingtrace_pipewill not block when polled.TRACEFS_OPTION_DISABLE_ON_FREEβ when thefree_bufferis closed, tracing will stop.TRACEFS_OPTION_DISPLAY_GRAPHβ when set, the latency tracers will use function graph tracing instead of function tracing.TRACEFS_OPTION_EVENT_FORKβ when set, tasks with PIDs listed inset_event_pidwill have the PIDs of their children added toset_event_pidwhen those tasks fork.TRACEFS_OPTION_FUNCTION_FORKβ when set, tasks with PIDs listed inset_ftrace_pidwill have the PIDs of their children added toset_ftrace_pidwhen those tasks fork.TRACEFS_OPTION_FUNCTION_TRACEβ when enabled, the latency tracers will trace functions.TRACEFS_OPTION_HEXβ display numbers in a hexadecimal format.TRACEFS_OPTION_IRQ_INFOβ display the interrupt, preempt count, need resched data.TRACEFS_OPTION_LATENCY_FORMATβ display additional information about the latency.TRACEFS_OPTION_MARKERSβ when set, thetrace_markeris enabled β writable (only by root).TRACEFS_OPTION_OVERWRITEβ controls what happens when the trace buffer is full. if set, the oldest events are discarded and overwritten. if disabled, then the newest events are discarded.TRACEFS_OPTION_PAUSE_ON_TRACEβ when set, opening the trace file for read will pause writing to the ring buffer. when the file is closed, tracing will be enabled again.TRACEFS_OPTION_PRINTK_MSG_ONLYβ when set,trace_printk()s will only show the format and not their parameters.TRACEFS_OPTION_PRINT_PARENTβ on function traces, display the calling (parent) function as well as the function being traced.TRACEFS_OPTION_RAWβ display raw numbers.TRACEFS_OPTION_RECORD_CMDβ save a mapping with a pid and corresponding command.TRACEFS_OPTION_RECORD_TGIDβ save a mapping with a pid and corresponding Thread Group IDs.TRACEFS_OPTION_STACKTRACEβ record a stack trace after any trace event.TRACEFS_OPTION_SYM_ADDRβ display the function address as well as the function name.TRACEFS_OPTION_SYM_OFFSETβ display not only the function name, but also the offset in the function.TRACEFS_OPTION_SYM_USEROBJβ whenTRACEFS_OPTION_USERSTACKTRACEis set, look up which object the address belongs to, and print the object and a relative address.TRACEFS_OPTION_TRACE_PRINTKβ disabletrace_printk()from writing into the buffer.TRACEFS_OPTION_USERSTACKTRACEβ records a stack trace of the current user space thread after each trace event.TRACEFS_OPTION_VERBOSEβ whenTRACEFS_OPTION_LATENCY_FORMATis enabled, print more detailed information.
π§ Options, specific to function tracer π§
TRACEFS_OPTION_FUNC_STACKTRACEβ record a stack trace after every function.
π Options, specific to function_graph tracer π
TRACEFS_OPTION_FGRAPH_ABSTIMEβ display the timestamp at each line.TRACEFS_OPTION_FGRAPH_CPUβ display the CPU number of the CPU where the trace occurred.TRACEFS_OPTION_FGRAPH_DURATIONβ display the duration of the amount of time at the end of each function, in microseconds.TRACEFS_OPTION_FGRAPH_IRQSβ trace functions that happen inside an interrupt.TRACEFS_OPTION_FGRAPH_OVERHEADβ display a marker if a function takes longer than a certain amount of time.TRACEFS_OPTION_FGRAPH_OVERRUNβ display"overrun"of the call graph, in the case of functions missed due to big callstack.TRACEFS_OPTION_FGRAPH_PROCβ display the command of each process at every line.TRACEFS_OPTION_FGRAPH_TAILβ display the function name on its return.TRACEFS_OPTION_SLEEP_TIMEβ account time the task has been scheduled out as part of the function call.TRACEFS_OPTION_GRAPH_TIMEβ display the time to call nested functions, if function profiler is enabled.
π Options, specific to blk tracer π
TRACEFS_OPTION_BLK_CGNAMEβ listed here under the blk tracer options; the source gives no extra description for this one.TRACEFS_OPTION_BLK_CGROUPβ also listed here under the blk tracer options; no extra description in the source either.TRACEFS_OPTION_BLK_CLASSICβ display a more minimalistic output.
π FILES π
tracefs.hβ header file to include in order to have access to the library APIs.-ltracefsβ linker switch to add when building a program that uses the library.
π SEE ALSO π
libtracefs(3)libtraceevent(3)trace-cmd(1)Documentation/trace/ftrace.rstfrom the Linux kernel tree.
π«Ά 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] π
π LICENSE π
libtracefs is Free Software licensed under the GNU LGPL 2.1.
π RESOURCES π
π COPYING π
Copyright (C) 2021 VMware, Inc. Free use of this software is granted under the terms of the GNU Public License (GPL).
π 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
okay that's the whole page, bestie β xoxo, your libtracefs hype girl π this was libtracefs 1.8.4, dated 10/21/2026. periodt π¦
π¦ where this page comes from
- arch rolling: libtracefs 1.8.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