• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1libtracefs(3)
2=============
3
4NAME
5----
6tracefs_options - ftrace options, that can be controlled using tracefs library.
7
8SYNOPSIS
9--------
10[verse]
11--
12*#include <tracefs.h>*
13
14enum tracefs_option_id {
15	*TRACEFS_OPTION_INVALID*,
16	*TRACEFS_OPTION_ANNOTATE*,
17	*TRACEFS_OPTION_BIN*,
18	*TRACEFS_OPTION_BLK_CGNAME*,
19	*TRACEFS_OPTION_BLK_CGROUP*,
20	*TRACEFS_OPTION_BLK_CLASSIC*,
21	*TRACEFS_OPTION_BLOCK*,
22	*TRACEFS_OPTION_CONTEXT_INFO*,
23	*TRACEFS_OPTION_DISABLE_ON_FREE*,
24	*TRACEFS_OPTION_DISPLAY_GRAPH*,
25	*TRACEFS_OPTION_EVENT_FORK*,
26	*TRACEFS_OPTION_FGRAPH_ABSTIME*,
27	*TRACEFS_OPTION_FGRAPH_CPU*,
28	*TRACEFS_OPTION_FGRAPH_DURATION*,
29	*TRACEFS_OPTION_FGRAPH_IRQS*,
30	*TRACEFS_OPTION_FGRAPH_OVERHEAD*,
31	*TRACEFS_OPTION_FGRAPH_OVERRUN*,
32	*TRACEFS_OPTION_FGRAPH_PROC*,
33	*TRACEFS_OPTION_FGRAPH_TAIL*,
34	*TRACEFS_OPTION_FUNC_STACKTRACE*,
35	*TRACEFS_OPTION_FUNCTION_FORK*,
36	*TRACEFS_OPTION_FUNCTION_TRACE*,
37	*TRACEFS_OPTION_GRAPH_TIME*,
38	*TRACEFS_OPTION_HEX*,
39	*TRACEFS_OPTION_IRQ_INFO*,
40	*TRACEFS_OPTION_LATENCY_FORMAT*,
41	*TRACEFS_OPTION_MARKERS*,
42	*TRACEFS_OPTION_OVERWRITE*,
43	*TRACEFS_OPTION_PAUSE_ON_TRACE*,
44	*TRACEFS_OPTION_PRINTK_MSG_ONLY*,
45	*TRACEFS_OPTION_PRINT_PARENT*,
46	*TRACEFS_OPTION_RAW*,
47	*TRACEFS_OPTION_RECORD_CMD*,
48	*TRACEFS_OPTION_RECORD_TGID*,
49	*TRACEFS_OPTION_SLEEP_TIME*,
50	*TRACEFS_OPTION_STACKTRACE*,
51	*TRACEFS_OPTION_SYM_ADDR*,
52	*TRACEFS_OPTION_SYM_OFFSET*,
53	*TRACEFS_OPTION_SYM_USEROBJ*,
54	*TRACEFS_OPTION_TRACE_PRINTK*,
55	*TRACEFS_OPTION_USERSTACKTRACE*,
56	*TRACEFS_OPTION_VERBOSE*,
57};
58--
59
60DESCRIPTION
61-----------
62This enum contains all ftrace options, that can be manipulated using tracefs library. More detailed
63information about each option is available in Documentation/trace/ftrace.rst from the Linux
64kernel tree, in the trace_options section. Note that some ftrace options cannot be manipulated by
65this library, as they are intended for internal, debug purposes. These options control the tracers
66or the trace output. All options have two states - on and off, the default state is different for
67each of them.
68[verse]
69--
70Common options for all tracers:
71	*TRACEFS_OPTION_INVALID* Not a valid ftrace option, used by the API to indicate an error.
72	*TRACEFS_OPTION_ANNOTATE* Display when a new CPU buffer started.
73	*TRACEFS_OPTION_BIN* Display the formats in raw binary.
74	*TRACEFS_OPTION_CONTEXT_INFO* Show only the event data. Hides the comm, PID, timestamp, CPU, and other useful data.
75	*TRACEFS_OPTION_BLOCK* When set, reading trace_pipe will not block when polled.
76	*TRACEFS_OPTION_DISABLE_ON_FREE* When the free_buffer is closed, tracing will stop.
77	*TRACEFS_OPTION_DISPLAY_GRAPH* When set, the latency tracers will use function graph tracing instead of function tracing.
78	*TRACEFS_OPTION_EVENT_FORK* When set, tasks with PIDs listed in set_event_pid will have the PIDs of their children added to set_event_pid when those tasks fork.
79	*TRACEFS_OPTION_FUNCTION_FORK* When set, tasks with PIDs listed in set_ftrace_pid will have the PIDs of their children added to set_ftrace_pid when those tasks fork.
80	*TRACEFS_OPTION_FUNCTION_TRACE* When enabled, the latency tracers will trace functions.
81	*TRACEFS_OPTION_HEX* Display numbers in a hexadecimal format.
82	*TRACEFS_OPTION_IRQ_INFO* Display the interrupt, preempt count, need resched data.
83	*TRACEFS_OPTION_LATENCY_FORMAT* Display additional information about the latency.
84	*TRACEFS_OPTION_MARKERS* When set, the trace_marker is enabled - writable (only by root).
85	*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.
86	*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.
87	*TRACEFS_OPTION_PRINTK_MSG_ONLY* When set, trace_printk()s will only show the format and not their parameters.
88	*TRACEFS_OPTION_PRINT_PARENT* On function traces, display the calling (parent) function as well as the function being traced.
89	*TRACEFS_OPTION_RAW* Display raw numbers.
90	*TRACEFS_OPTION_RECORD_CMD* Save a mapping with a pid and corresponding command.
91	*TRACEFS_OPTION_RECORD_TGID* Save a mapping with a pid and corresponding Thread Group IDs.
92	*TRACEFS_OPTION_STACKTRACE* Record a stack trace after any trace event.
93	*TRACEFS_OPTION_SYM_ADDR* Display the function address as well as the function name.
94	*TRACEFS_OPTION_SYM_OFFSET* Display not only the function name, but also the offset in the function.
95	*TRACEFS_OPTION_SYM_USEROBJ* When *TRACEFS_OPTION_USERSTACKTRACE* is set, look up which object the address belongs to, and print the object and a relative address.
96	*TRACEFS_OPTION_TRACE_PRINTK* Disable trace_printk() from writing into the buffer.
97	*TRACEFS_OPTION_USERSTACKTRACE* Records a stack trace of the current user space thread after each trace event.
98	*TRACEFS_OPTION_VERBOSE* When *TRACEFS_OPTION_LATENCY_FORMAT* is enabled, print more detailed information.
99
100Options, specific to function tracer:
101	*TRACEFS_OPTION_FUNC_STACKTRACE* Record a stack trace after every function.
102
103Options, specific to function_graph tracer:
104	*TRACEFS_OPTION_FGRAPH_ABSTIME* Display the timestamp at each line.
105	*TRACEFS_OPTION_FGRAPH_CPU* Display the CPU number of the CPU where the trace occurred.
106	*TRACEFS_OPTION_FGRAPH_DURATION* Display the duration of the amount of time at the end of each function, in microseconds.
107	*TRACEFS_OPTION_FGRAPH_IRQS* Trace functions that happen inside an interrupt.
108	*TRACEFS_OPTION_FGRAPH_OVERHEAD* Display a marker if a function takes longer than a certain amount of time.
109	*TRACEFS_OPTION_FGRAPH_OVERRUN* Display "overrun" of the call graph, in the case of functions missed due to big callstack.
110	*TRACEFS_OPTION_FGRAPH_PROC* Display the command of each process at every line.
111	*TRACEFS_OPTION_FGRAPH_TAIL* Display the function name on its return.
112	*TRACEFS_OPTION_SLEEP_TIME* Account time the task has been scheduled out as part of the function call.
113	*TRACEFS_OPTION_GRAPH_TIME* Display the time to call nested functions, if function profiler is enabled.
114
115Options, specific to blk tracer:
116	*TRACEFS_OPTION_BLK_CGNAME*
117	*TRACEFS_OPTION_BLK_CGROUP*
118	*TRACEFS_OPTION_BLK_CLASSIC* Display a more minimalistic output.
119--
120FILES
121-----
122[verse]
123--
124*tracefs.h*
125	Header file to include in order to have access to the library APIs.
126*-ltracefs*
127	Linker switch to add when building a program that uses the library.
128--
129
130SEE ALSO
131--------
132*libtracefs*(3),
133*libtraceevent*(3),
134*trace-cmd*(1),
135_Documentation/trace/ftrace.rst_ from the Linux kernel tree.
136
137AUTHOR
138------
139[verse]
140--
141*Steven Rostedt* <rostedt@goodmis.org>
142*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>
143--
144REPORTING BUGS
145--------------
146Report bugs to  <linux-trace-devel@vger.kernel.org>
147
148LICENSE
149-------
150libtracefs is Free Software licensed under the GNU LGPL 2.1
151
152RESOURCES
153---------
154https://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/
155
156COPYING
157-------
158Copyright \(C) 2021 VMware, Inc. Free use of this software is granted under
159the terms of the GNU Public License (GPL).
160