xref: /aosp_15_r20/external/libtraceevent/Documentation/libtraceevent-set_flag.txt (revision 436bf2bcd5202612ffffe471bbcc1f277cc8d28e)
1*436bf2bcSAndroid Build Coastguard Workerlibtraceevent(3)
2*436bf2bcSAndroid Build Coastguard Worker================
3*436bf2bcSAndroid Build Coastguard Worker
4*436bf2bcSAndroid Build Coastguard WorkerNAME
5*436bf2bcSAndroid Build Coastguard Worker----
6*436bf2bcSAndroid Build Coastguard Workertep_set_flag, tep_clear_flag, tep_test_flag -
7*436bf2bcSAndroid Build Coastguard WorkerManage flags of trace event parser context.
8*436bf2bcSAndroid Build Coastguard Worker
9*436bf2bcSAndroid Build Coastguard WorkerSYNOPSIS
10*436bf2bcSAndroid Build Coastguard Worker--------
11*436bf2bcSAndroid Build Coastguard Worker[verse]
12*436bf2bcSAndroid Build Coastguard Worker--
13*436bf2bcSAndroid Build Coastguard Worker*#include <event-parse.h>*
14*436bf2bcSAndroid Build Coastguard Worker
15*436bf2bcSAndroid Build Coastguard Workerenum *tep_flag* {
16*436bf2bcSAndroid Build Coastguard Worker	_TEP_NSEC_OUTPUT_,
17*436bf2bcSAndroid Build Coastguard Worker	_TEP_DISABLE_SYS_PLUGINS_,
18*436bf2bcSAndroid Build Coastguard Worker	_TEP_DISABLE_PLUGINS_
19*436bf2bcSAndroid Build Coastguard Worker};
20*436bf2bcSAndroid Build Coastguard Workervoid *tep_set_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
21*436bf2bcSAndroid Build Coastguard Workervoid *tep_clear_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
22*436bf2bcSAndroid Build Coastguard Workerbool *tep_test_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
23*436bf2bcSAndroid Build Coastguard Worker--
24*436bf2bcSAndroid Build Coastguard Worker
25*436bf2bcSAndroid Build Coastguard WorkerDESCRIPTION
26*436bf2bcSAndroid Build Coastguard Worker-----------
27*436bf2bcSAndroid Build Coastguard WorkerTrace event parser context flags are defined in *enum tep_flag*:
28*436bf2bcSAndroid Build Coastguard Worker[verse]
29*436bf2bcSAndroid Build Coastguard Worker--
30*436bf2bcSAndroid Build Coastguard Worker_TEP_NSEC_OUTPUT_ - print event's timestamp in nano seconds, instead of micro seconds.
31*436bf2bcSAndroid Build Coastguard Worker_TEP_DISABLE_SYS_PLUGINS_ - disable plugins, located in system's plugin
32*436bf2bcSAndroid Build Coastguard Worker			directory. This directory is defined at library compile
33*436bf2bcSAndroid Build Coastguard Worker			time, and usually depends on library installation
34*436bf2bcSAndroid Build Coastguard Worker			prefix: (install_preffix)/lib/traceevent/plugins
35*436bf2bcSAndroid Build Coastguard Worker_TEP_DISABLE_PLUGINS_ - disable all library plugins:
36*436bf2bcSAndroid Build Coastguard Worker			- in system's plugin directory
37*436bf2bcSAndroid Build Coastguard Worker			- in directory, defined by the environment variable _TRACEEVENT_PLUGIN_DIR_
38*436bf2bcSAndroid Build Coastguard Worker			- in user's home directory, _~/.traceevent/plugins_
39*436bf2bcSAndroid Build Coastguard Worker--
40*436bf2bcSAndroid Build Coastguard WorkerNote: plugin related flags must me set before calling *tep_load_plugins()* API.
41*436bf2bcSAndroid Build Coastguard Worker
42*436bf2bcSAndroid Build Coastguard WorkerThe *tep_set_flag()* function sets _flag_ to _tep_ context.
43*436bf2bcSAndroid Build Coastguard Worker
44*436bf2bcSAndroid Build Coastguard WorkerThe *tep_clear_flag()* function clears _flag_ from _tep_ context.
45*436bf2bcSAndroid Build Coastguard Worker
46*436bf2bcSAndroid Build Coastguard WorkerThe *tep_test_flag()* function tests if _flag_ is set to _tep_ context.
47*436bf2bcSAndroid Build Coastguard Worker
48*436bf2bcSAndroid Build Coastguard WorkerRETURN VALUE
49*436bf2bcSAndroid Build Coastguard Worker------------
50*436bf2bcSAndroid Build Coastguard Worker*tep_test_flag()* function returns true if _flag_ is set, false otherwise.
51*436bf2bcSAndroid Build Coastguard Worker
52*436bf2bcSAndroid Build Coastguard WorkerEXAMPLE
53*436bf2bcSAndroid Build Coastguard Worker-------
54*436bf2bcSAndroid Build Coastguard Worker[source,c]
55*436bf2bcSAndroid Build Coastguard Worker--
56*436bf2bcSAndroid Build Coastguard Worker#include <event-parse.h>
57*436bf2bcSAndroid Build Coastguard Worker...
58*436bf2bcSAndroid Build Coastguard Workerstruct tep_handle *tep = tep_alloc();
59*436bf2bcSAndroid Build Coastguard Worker...
60*436bf2bcSAndroid Build Coastguard Worker/* Print timestamps in nanoseconds */
61*436bf2bcSAndroid Build Coastguard Workertep_set_flag(tep,  TEP_NSEC_OUTPUT);
62*436bf2bcSAndroid Build Coastguard Worker...
63*436bf2bcSAndroid Build Coastguard Workerif (tep_test_flag(tep, TEP_NSEC_OUTPUT)) {
64*436bf2bcSAndroid Build Coastguard Worker	/* print timestamps in nanoseconds */
65*436bf2bcSAndroid Build Coastguard Worker} else {
66*436bf2bcSAndroid Build Coastguard Worker	/* print timestamps in microseconds */
67*436bf2bcSAndroid Build Coastguard Worker}
68*436bf2bcSAndroid Build Coastguard Worker...
69*436bf2bcSAndroid Build Coastguard Worker/* Print timestamps in microseconds */
70*436bf2bcSAndroid Build Coastguard Workertep_clear_flag(tep, TEP_NSEC_OUTPUT);
71*436bf2bcSAndroid Build Coastguard Worker...
72*436bf2bcSAndroid Build Coastguard Worker--
73*436bf2bcSAndroid Build Coastguard WorkerFILES
74*436bf2bcSAndroid Build Coastguard Worker-----
75*436bf2bcSAndroid Build Coastguard Worker[verse]
76*436bf2bcSAndroid Build Coastguard Worker--
77*436bf2bcSAndroid Build Coastguard Worker*event-parse.h*
78*436bf2bcSAndroid Build Coastguard Worker	Header file to include in order to have access to the library APIs.
79*436bf2bcSAndroid Build Coastguard Worker*-ltraceevent*
80*436bf2bcSAndroid Build Coastguard Worker	Linker switch to add when building a program that uses the library.
81*436bf2bcSAndroid Build Coastguard Worker--
82*436bf2bcSAndroid Build Coastguard Worker
83*436bf2bcSAndroid Build Coastguard WorkerSEE ALSO
84*436bf2bcSAndroid Build Coastguard Worker--------
85*436bf2bcSAndroid Build Coastguard Worker*libtraceevent*(3), *trace-cmd*(1)
86*436bf2bcSAndroid Build Coastguard Worker
87*436bf2bcSAndroid Build Coastguard WorkerAUTHOR
88*436bf2bcSAndroid Build Coastguard Worker------
89*436bf2bcSAndroid Build Coastguard Worker[verse]
90*436bf2bcSAndroid Build Coastguard Worker--
91*436bf2bcSAndroid Build Coastguard Worker*Steven Rostedt* <[email protected]>, author of *libtraceevent*.
92*436bf2bcSAndroid Build Coastguard Worker*Tzvetomir Stoyanov* <[email protected]>, author of this man page.
93*436bf2bcSAndroid Build Coastguard Worker--
94*436bf2bcSAndroid Build Coastguard WorkerREPORTING BUGS
95*436bf2bcSAndroid Build Coastguard Worker--------------
96*436bf2bcSAndroid Build Coastguard WorkerReport bugs to  <[email protected]>
97*436bf2bcSAndroid Build Coastguard Worker
98*436bf2bcSAndroid Build Coastguard WorkerLICENSE
99*436bf2bcSAndroid Build Coastguard Worker-------
100*436bf2bcSAndroid Build Coastguard Workerlibtraceevent is Free Software licensed under the GNU LGPL 2.1
101*436bf2bcSAndroid Build Coastguard Worker
102*436bf2bcSAndroid Build Coastguard WorkerRESOURCES
103*436bf2bcSAndroid Build Coastguard Worker---------
104*436bf2bcSAndroid Build Coastguard Workerhttps://git.kernel.org/pub/scm/libs/libtrace/libtraceevent.git/
105