xref: /OK3568_Linux_fs/kernel/tools/lib/traceevent/Documentation/libtraceevent-set_flag.txt (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunlibtraceevent(3)
2*4882a593Smuzhiyun================
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunNAME
5*4882a593Smuzhiyun----
6*4882a593Smuzhiyuntep_set_flag, tep_clear_flag, tep_test_flag -
7*4882a593SmuzhiyunManage flags of trace event parser context.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunSYNOPSIS
10*4882a593Smuzhiyun--------
11*4882a593Smuzhiyun[verse]
12*4882a593Smuzhiyun--
13*4882a593Smuzhiyun*#include <event-parse.h>*
14*4882a593Smuzhiyun
15*4882a593Smuzhiyunenum *tep_flag* {
16*4882a593Smuzhiyun	_TEP_NSEC_OUTPUT_,
17*4882a593Smuzhiyun	_TEP_DISABLE_SYS_PLUGINS_,
18*4882a593Smuzhiyun	_TEP_DISABLE_PLUGINS_
19*4882a593Smuzhiyun};
20*4882a593Smuzhiyunvoid *tep_set_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
21*4882a593Smuzhiyunvoid *tep_clear_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
22*4882a593Smuzhiyunbool *tep_test_flag*(struct tep_handle pass:[*]_tep_, enum tep_flag _flag_);
23*4882a593Smuzhiyun--
24*4882a593Smuzhiyun
25*4882a593SmuzhiyunDESCRIPTION
26*4882a593Smuzhiyun-----------
27*4882a593SmuzhiyunTrace event parser context flags are defined in *enum tep_flag*:
28*4882a593Smuzhiyun[verse]
29*4882a593Smuzhiyun--
30*4882a593Smuzhiyun_TEP_NSEC_OUTPUT_ - print event's timestamp in nano seconds, instead of micro seconds.
31*4882a593Smuzhiyun_TEP_DISABLE_SYS_PLUGINS_ - disable plugins, located in system's plugin
32*4882a593Smuzhiyun			directory. This directory is defined at library compile
33*4882a593Smuzhiyun			time, and usually depends on library installation
34*4882a593Smuzhiyun			prefix: (install_preffix)/lib/traceevent/plugins
35*4882a593Smuzhiyun_TEP_DISABLE_PLUGINS_ - disable all library plugins:
36*4882a593Smuzhiyun			- in system's plugin directory
37*4882a593Smuzhiyun			- in directory, defined by the environment variable _TRACEEVENT_PLUGIN_DIR_
38*4882a593Smuzhiyun			- in user's home directory, _~/.traceevent/plugins_
39*4882a593Smuzhiyun--
40*4882a593SmuzhiyunNote: plugin related flags must me set before calling _tep_load_plugins()_ API.
41*4882a593Smuzhiyun
42*4882a593SmuzhiyunThe _tep_set_flag()_ function sets _flag_ to _tep_ context.
43*4882a593Smuzhiyun
44*4882a593SmuzhiyunThe _tep_clear_flag()_ function clears _flag_ from _tep_ context.
45*4882a593Smuzhiyun
46*4882a593SmuzhiyunThe _tep_test_flag()_ function tests if _flag_ is set to _tep_ context.
47*4882a593Smuzhiyun
48*4882a593SmuzhiyunRETURN VALUE
49*4882a593Smuzhiyun------------
50*4882a593Smuzhiyun_tep_test_flag()_ function returns true if _flag_ is set, false otherwise.
51*4882a593Smuzhiyun
52*4882a593SmuzhiyunEXAMPLE
53*4882a593Smuzhiyun-------
54*4882a593Smuzhiyun[source,c]
55*4882a593Smuzhiyun--
56*4882a593Smuzhiyun#include <event-parse.h>
57*4882a593Smuzhiyun...
58*4882a593Smuzhiyunstruct tep_handle *tep = tep_alloc();
59*4882a593Smuzhiyun...
60*4882a593Smuzhiyun/* Print timestamps in nanoseconds */
61*4882a593Smuzhiyuntep_set_flag(tep,  TEP_NSEC_OUTPUT);
62*4882a593Smuzhiyun...
63*4882a593Smuzhiyunif (tep_test_flag(tep, TEP_NSEC_OUTPUT)) {
64*4882a593Smuzhiyun	/* print timestamps in nanoseconds */
65*4882a593Smuzhiyun} else {
66*4882a593Smuzhiyun	/* print timestamps in microseconds */
67*4882a593Smuzhiyun}
68*4882a593Smuzhiyun...
69*4882a593Smuzhiyun/* Print timestamps in microseconds */
70*4882a593Smuzhiyuntep_clear_flag(tep, TEP_NSEC_OUTPUT);
71*4882a593Smuzhiyun...
72*4882a593Smuzhiyun--
73*4882a593SmuzhiyunFILES
74*4882a593Smuzhiyun-----
75*4882a593Smuzhiyun[verse]
76*4882a593Smuzhiyun--
77*4882a593Smuzhiyun*event-parse.h*
78*4882a593Smuzhiyun	Header file to include in order to have access to the library APIs.
79*4882a593Smuzhiyun*-ltraceevent*
80*4882a593Smuzhiyun	Linker switch to add when building a program that uses the library.
81*4882a593Smuzhiyun--
82*4882a593Smuzhiyun
83*4882a593SmuzhiyunSEE ALSO
84*4882a593Smuzhiyun--------
85*4882a593Smuzhiyun_libtraceevent(3)_, _trace-cmd(1)_
86*4882a593Smuzhiyun
87*4882a593SmuzhiyunAUTHOR
88*4882a593Smuzhiyun------
89*4882a593Smuzhiyun[verse]
90*4882a593Smuzhiyun--
91*4882a593Smuzhiyun*Steven Rostedt* <rostedt@goodmis.org>, author of *libtraceevent*.
92*4882a593Smuzhiyun*Tzvetomir Stoyanov* <tz.stoyanov@gmail.com>, author of this man page.
93*4882a593Smuzhiyun--
94*4882a593SmuzhiyunREPORTING BUGS
95*4882a593Smuzhiyun--------------
96*4882a593SmuzhiyunReport bugs to  <linux-trace-devel@vger.kernel.org>
97*4882a593Smuzhiyun
98*4882a593SmuzhiyunLICENSE
99*4882a593Smuzhiyun-------
100*4882a593Smuzhiyunlibtraceevent is Free Software licensed under the GNU LGPL 2.1
101*4882a593Smuzhiyun
102*4882a593SmuzhiyunRESOURCES
103*4882a593Smuzhiyun---------
104*4882a593Smuzhiyunhttps://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
105