xref: /aosp_15_r20/external/libtracefs/Documentation/libtracefs-synth.txt (revision 287e80b3a36113050663245e7f2c00d274188f18)
1*287e80b3SSadaf Ebrahimilibtracefs(3)
2*287e80b3SSadaf Ebrahimi=============
3*287e80b3SSadaf Ebrahimi
4*287e80b3SSadaf EbrahimiNAME
5*287e80b3SSadaf Ebrahimi----
6*287e80b3SSadaf Ebrahimitracefs_synth_alloc, tracefs_synth_add_match_field, tracefs_synth_add_compare_field, tracefs_synth_add_start_field,
7*287e80b3SSadaf Ebrahimitracefs_synth_add_end_field, tracefs_synth_append_start_filter, tracefs_synth_append_end_filter, tracefs_synth_free,
8*287e80b3SSadaf Ebrahimi- Creation of a synthetic event descriptor
9*287e80b3SSadaf Ebrahimi
10*287e80b3SSadaf EbrahimiSYNOPSIS
11*287e80b3SSadaf Ebrahimi--------
12*287e80b3SSadaf Ebrahimi[verse]
13*287e80b3SSadaf Ebrahimi--
14*287e80b3SSadaf Ebrahimi*#include <tracefs.h>*
15*287e80b3SSadaf Ebrahimi
16*287e80b3SSadaf Ebrahimistruct tracefs_synth pass:[*]*tracefs_synth_alloc*(struct tep_handle pass:[*]_tep_,
17*287e80b3SSadaf Ebrahimi					 const char pass:[*]_name_,
18*287e80b3SSadaf Ebrahimi					 const char pass:[*]_start_system_,
19*287e80b3SSadaf Ebrahimi					 const char pass:[*]_start_event_,
20*287e80b3SSadaf Ebrahimi					 const char pass:[*]_end_system_,
21*287e80b3SSadaf Ebrahimi					 const char pass:[*]_end_event_,
22*287e80b3SSadaf Ebrahimi					 const char pass:[*]_start_match_field_,
23*287e80b3SSadaf Ebrahimi					 const char pass:[*]_end_match_field_,
24*287e80b3SSadaf Ebrahimi					 const char pass:[*]_match_name_);
25*287e80b3SSadaf Ebrahimiint *tracefs_synth_add_match_field*(struct tracefs_synth pass:[*]_synth_,
26*287e80b3SSadaf Ebrahimi				  const char pass:[*]_start_match_field_,
27*287e80b3SSadaf Ebrahimi				  const char pass:[*]_end_match_field_,
28*287e80b3SSadaf Ebrahimi				  const char pass:[*]_name_);
29*287e80b3SSadaf Ebrahimiint *tracefs_synth_add_compare_field*(struct tracefs_synth pass:[*]_synth_,
30*287e80b3SSadaf Ebrahimi				    const char pass:[*]_start_compare_field_,
31*287e80b3SSadaf Ebrahimi				    const char pass:[*]_end_compare_field_,
32*287e80b3SSadaf Ebrahimi				    enum tracefs_synth_calc _calc_,
33*287e80b3SSadaf Ebrahimi				    const char pass:[*]_name_);
34*287e80b3SSadaf Ebrahimiint *tracefs_synth_add_start_field*(struct tracefs_synth pass:[*]_synth_,
35*287e80b3SSadaf Ebrahimi				  const char pass:[*]_start_field_,
36*287e80b3SSadaf Ebrahimi				  const char pass:[*]_name_);
37*287e80b3SSadaf Ebrahimiint *tracefs_synth_add_end_field*(struct tracefs_synth pass:[*]_synth_,
38*287e80b3SSadaf Ebrahimi				const char pass:[*]_end_field_,
39*287e80b3SSadaf Ebrahimi				const char pass:[*]_name_);
40*287e80b3SSadaf Ebrahimiint *tracefs_synth_append_start_filter*(struct tracefs_synth pass:[*]_synth_,
41*287e80b3SSadaf Ebrahimi				      struct tracefs_filter _type_,
42*287e80b3SSadaf Ebrahimi				      const char pass:[*]_field_,
43*287e80b3SSadaf Ebrahimi				      enum tracefs_synth_compare _compare_,
44*287e80b3SSadaf Ebrahimi				      const char pass:[*]_val_);
45*287e80b3SSadaf Ebrahimiint *tracefs_synth_append_end_filter*(struct tracefs_synth pass:[*]_synth_,
46*287e80b3SSadaf Ebrahimi				    struct tracefs_filter _type_,
47*287e80b3SSadaf Ebrahimi				    const char pass:[*]_field_,
48*287e80b3SSadaf Ebrahimi				    enum tracefs_synth_compare _compare_,
49*287e80b3SSadaf Ebrahimi				    const char pass:[*]_val_);
50*287e80b3SSadaf Ebrahimivoid *tracefs_synth_free*(struct tracefs_synth pass:[*]_synth_);
51*287e80b3SSadaf Ebrahimi--
52*287e80b3SSadaf Ebrahimi
53*287e80b3SSadaf EbrahimiDESCRIPTION
54*287e80b3SSadaf Ebrahimi-----------
55*287e80b3SSadaf EbrahimiSynthetic events are dynamic events that are created by matching
56*287e80b3SSadaf Ebrahimitwo other events which triggers a synthetic event. One event is the starting
57*287e80b3SSadaf Ebrahimievent which some field is recorded, and when the second event is executed,
58*287e80b3SSadaf Ebrahimiif it has a field (or fields) that matches the starting event's field (or fields)
59*287e80b3SSadaf Ebrahimithen it will trigger the synthetic event. The field values other than the matching
60*287e80b3SSadaf Ebrahimifields may be passed from the starting event to the end event to perform calculations
61*287e80b3SSadaf Ebrahimion, or to simply pass as a parameter to the synthetic event.
62*287e80b3SSadaf Ebrahimi
63*287e80b3SSadaf EbrahimiOne common use case is to set "sched_waking" as the starting event. This event is
64*287e80b3SSadaf Ebrahimitriggered when a process is awoken. Then set "sched_switch" as the ending event.
65*287e80b3SSadaf EbrahimiThis event is triggered when a new task is scheduled on the CPU. By setting
66*287e80b3SSadaf Ebrahimithe "common_pid" of both events as the matching fields, the time between the
67*287e80b3SSadaf Ebrahimitwo events is considered the wake up latency of that process. Use *TRACEFS_TIMESTAMP*
68*287e80b3SSadaf Ebrahimias a field for both events to calculate the delta in nanoseconds, or use
69*287e80b3SSadaf Ebrahimi*TRACEFS_TIMESTAMP_USECS" as the compare fields for both events to calculate the
70*287e80b3SSadaf Ebrahimidelta in microseconds. This is used as the example below.
71*287e80b3SSadaf Ebrahimi
72*287e80b3SSadaf Ebrahimi*tracefs_synth_alloc*() allocates and initializes a synthetic event.
73*287e80b3SSadaf EbrahimiIt does not create the synthetic event, but supplies the minimal information
74*287e80b3SSadaf Ebrahimito do so. See *tracefs_synth_create*(3) for how to create the synthetic
75*287e80b3SSadaf Ebrahimievent in the system. It requires a _tep_ handler that can be created by
76*287e80b3SSadaf Ebrahimi*tracefs_local_events*(3) for more information. The _name_ holds the name
77*287e80b3SSadaf Ebrahimiof the synthetic event that will be created. The _start_system_ is the name
78*287e80b3SSadaf Ebrahimiof the system for the starting event. It may be NULL and the first event
79*287e80b3SSadaf Ebrahimiwith the name of _start_event_ will be chosen. The _end_system_ is the
80*287e80b3SSadaf Ebrahiminame of the system for theh ending event. It may be NULL and the first event
81*287e80b3SSadaf Ebrahimiwith the name of _end_event_ will be chosen as the ending event. If _match_name_
82*287e80b3SSadaf Ebrahimiis given, then this will be the field of the created synthetic event that
83*287e80b3SSadaf Ebrahimiholds the matching keys of the starting event's _start_match_field_ and
84*287e80b3SSadaf Ebrahimithe ending event's _end_match_field_. If _match_name_ is NULL, then it will
85*287e80b3SSadaf Ebrahiminot be recorded in the created synthetic event.
86*287e80b3SSadaf Ebrahimi
87*287e80b3SSadaf Ebrahimi*tracefs_synth_add_match_field*() will add a second key to match between the
88*287e80b3SSadaf Ebrahimistarting event and the ending event. If _name_ is given, then the content
89*287e80b3SSadaf Ebrahimiof the matching field will be saved by this _name_ in the synthetic event.
90*287e80b3SSadaf EbrahimiThe _start_match_field_ is the field of the starting event to mach with the
91*287e80b3SSadaf Ebrahimiending event's _end_match_field_.
92*287e80b3SSadaf Ebrahimi
93*287e80b3SSadaf Ebrahimi*tracefs_synth_add_compare_field*() is used to compare the _start_compare_field_
94*287e80b3SSadaf Ebrahimiof the starting event with the _end_compare_field_ of the ending event. The _name_
95*287e80b3SSadaf Ebrahimimust be given so that the result will be saved by the synthetic event. It makes
96*287e80b3SSadaf Ebrahimino sense to not pass this to the synthetic event after doing the work of
97*287e80b3SSadaf Ebrahimithe compared fields, as it serves no other purpose. The _calc_ parameter
98*287e80b3SSadaf Ebrahimican be one of:
99*287e80b3SSadaf Ebrahimi
100*287e80b3SSadaf Ebrahimi*TRACEFS_SYNTH_DELTA_END* - calculate the difference between the content in
101*287e80b3SSadaf Ebrahimi the _end_compare_field_ from the content of the _start_compare_field_.
102*287e80b3SSadaf Ebrahimi
103*287e80b3SSadaf Ebrahimi_name_ = _end_compare_field_ - _start_compare_field_
104*287e80b3SSadaf Ebrahimi
105*287e80b3SSadaf Ebrahimi*TRACEFS_SYNTH_DELTA_START* - calculate the difference between the content in
106*287e80b3SSadaf Ebrahimi the _start_compare_field_ from the content of the _end_compare_field_.
107*287e80b3SSadaf Ebrahimi
108*287e80b3SSadaf Ebrahimi_name_ = _start_compare_field_ - _end_compare_field_
109*287e80b3SSadaf Ebrahimi
110*287e80b3SSadaf Ebrahimi*TRACEFS_SYNTH_ADD* - Add the content of the _start_compare_field_ to the
111*287e80b3SSadaf Ebrahimi  content of the _end_compare_field_.
112*287e80b3SSadaf Ebrahimi
113*287e80b3SSadaf Ebrahimi_name_ = _start_compare_field_ + _end_compare_field_
114*287e80b3SSadaf Ebrahimi
115*287e80b3SSadaf Ebrahimi*tracefs_synth_add_start_field*() - Records the _start_field_ of the starting
116*287e80b3SSadaf Ebrahimievent as _name_ in the synthetic event. If _name_ is NULL, then the name used
117*287e80b3SSadaf Ebrahimiwill be the same as _start_field_.
118*287e80b3SSadaf Ebrahimi
119*287e80b3SSadaf Ebrahimi*tracefs_synth_add_end_field*() - Records the _end_field_ of the ending
120*287e80b3SSadaf Ebrahimievent as _name_ in the synthetic event. If _name_ is NULL, then the name used
121*287e80b3SSadaf Ebrahimiwill be the same as _end_field_.
122*287e80b3SSadaf Ebrahimi
123*287e80b3SSadaf Ebrahimi*tracefs_synth_append_start_filter*() creates a filter or appends to it for the
124*287e80b3SSadaf Ebrahimistarting event. Depending on _type_, it will build a string of tokens for
125*287e80b3SSadaf Ebrahimiparenthesis or logic statements, or it may add a comparison of _field_
126*287e80b3SSadaf Ebrahimito _val_ based on _compare_.
127*287e80b3SSadaf Ebrahimi
128*287e80b3SSadaf EbrahimiIf _type_ is:
129*287e80b3SSadaf Ebrahimi*TRACEFS_FILTER_COMPARE*     -  See below
130*287e80b3SSadaf Ebrahimi*TRACEFS_FILTER_AND*         -  Append "&&" to the filter
131*287e80b3SSadaf Ebrahimi*TRACEFS_FILTER_OR*          -  Append "||" to the filter
132*287e80b3SSadaf Ebrahimi*TRACEFS_FILTER_NOT*         -  Append "!" to the filter
133*287e80b3SSadaf Ebrahimi*TRACEFS_FILTER_OPEN_PAREN*  -  Append "(" to the filter
134*287e80b3SSadaf Ebrahimi*TRACEFS_FILTER_CLOSE_PAREN* -  Append ")" to the filter
135*287e80b3SSadaf Ebrahimi
136*287e80b3SSadaf Ebrahimi_field_, _compare_, and _val_ are ignored unless _type_ is equal to
137*287e80b3SSadaf Ebrahimi*TRACEFS_FILTER_COMPARE*, then _compare will be used for the following:
138*287e80b3SSadaf Ebrahimi
139*287e80b3SSadaf Ebrahimi*TRACEFS_COMPARE_EQ* - _field_ == _val_
140*287e80b3SSadaf Ebrahimi
141*287e80b3SSadaf Ebrahimi*TRACEFS_COMPARE_NE* - _field_ != _val_
142*287e80b3SSadaf Ebrahimi
143*287e80b3SSadaf Ebrahimi*TRACEFS_COMPARE_GT* - _field_ > _val_
144*287e80b3SSadaf Ebrahimi
145*287e80b3SSadaf Ebrahimi*TRACEFS_COMPARE_GE* - _field_ >= _val_
146*287e80b3SSadaf Ebrahimi
147*287e80b3SSadaf Ebrahimi*TRACEFS_COMPARE_LT* - _field_ < _val_
148*287e80b3SSadaf Ebrahimi
149*287e80b3SSadaf Ebrahimi*TRACEFS_COMPARE_LE* - _field_ <pass:[=] _val_
150*287e80b3SSadaf Ebrahimi
151*287e80b3SSadaf Ebrahimi*TRACEFS_COMPARE_RE* - _field_ ~ "_val_" : where _field_ is a string.
152*287e80b3SSadaf Ebrahimi
153*287e80b3SSadaf Ebrahimi*TRACEFS_COMPARE_AND* - _field_ & _val_ : where _field_ is a flags field.
154*287e80b3SSadaf Ebrahimi
155*287e80b3SSadaf Ebrahimi*tracefs_synth_append_end_filter*() is the same as *tracefs_synth_append_start_filter* but
156*287e80b3SSadaf Ebrahimifilters on the ending event.
157*287e80b3SSadaf Ebrahimi
158*287e80b3SSadaf Ebrahimi*tracefs_synth_free*() frees the allocated descriptor returned by
159*287e80b3SSadaf Ebrahimi*tracefs_synth_alloc*().
160*287e80b3SSadaf Ebrahimi
161*287e80b3SSadaf EbrahimiRETURN VALUE
162*287e80b3SSadaf Ebrahimi------------
163*287e80b3SSadaf Ebrahimi*tracefs_synth_alloc*() returns an allocated struct tracefs_synth descriptor
164*287e80b3SSadaf Ebrahimion success or NULL on error.
165*287e80b3SSadaf Ebrahimi
166*287e80b3SSadaf EbrahimiAll other functions that return an integer returns zero on success or -1
167*287e80b3SSadaf Ebrahimion error.
168*287e80b3SSadaf Ebrahimi
169*287e80b3SSadaf EbrahimiERRORS
170*287e80b3SSadaf Ebrahimi------
171*287e80b3SSadaf EbrahimiThe following errors are for all the above calls:
172*287e80b3SSadaf Ebrahimi
173*287e80b3SSadaf Ebrahimi*EPERM* Not run as root user when required.
174*287e80b3SSadaf Ebrahimi
175*287e80b3SSadaf Ebrahimi*EINVAL* Either a parameter is not valid (NULL when it should not be)
176*287e80b3SSadaf Ebrahimi  or a field that is not compatible for calculations.
177*287e80b3SSadaf Ebrahimi
178*287e80b3SSadaf Ebrahimi*ENODEV* An event or one of its fields is not found.
179*287e80b3SSadaf Ebrahimi
180*287e80b3SSadaf Ebrahimi*EBADE* The fields of the start and end events are not compatible for
181*287e80b3SSadaf Ebrahimi  either matching or comparing.
182*287e80b3SSadaf Ebrahimi
183*287e80b3SSadaf Ebrahimi*ENOMEM* not enough memory is available.
184*287e80b3SSadaf Ebrahimi
185*287e80b3SSadaf EbrahimiAnd more errors may have happened from the system calls to the system.
186*287e80b3SSadaf Ebrahimi
187*287e80b3SSadaf EbrahimiEXAMPLE
188*287e80b3SSadaf Ebrahimi-------
189*287e80b3SSadaf Ebrahimi[source,c]
190*287e80b3SSadaf Ebrahimi--
191*287e80b3SSadaf Ebrahimi#include <stdlib.h>
192*287e80b3SSadaf Ebrahimi#include <tracefs.h>
193*287e80b3SSadaf Ebrahimi
194*287e80b3SSadaf Ebrahimi#define start_event "sched_waking"
195*287e80b3SSadaf Ebrahimi#define start_field "pid"
196*287e80b3SSadaf Ebrahimi
197*287e80b3SSadaf Ebrahimi#define end_event "sched_switch"
198*287e80b3SSadaf Ebrahimi#define end_field "next_pid"
199*287e80b3SSadaf Ebrahimi
200*287e80b3SSadaf Ebrahimi#define match_name "pid"
201*287e80b3SSadaf Ebrahimi
202*287e80b3SSadaf Ebrahimistatic struct tracefs_synth *synth;
203*287e80b3SSadaf Ebrahimi
204*287e80b3SSadaf Ebrahimistatic void make_event(void)
205*287e80b3SSadaf Ebrahimi{
206*287e80b3SSadaf Ebrahimi	struct tep_handle *tep;
207*287e80b3SSadaf Ebrahimi
208*287e80b3SSadaf Ebrahimi	/* Load all events from the system */
209*287e80b3SSadaf Ebrahimi	tep = tracefs_local_events(NULL);
210*287e80b3SSadaf Ebrahimi
211*287e80b3SSadaf Ebrahimi	/* Initialize the synthetic event */
212*287e80b3SSadaf Ebrahimi	synth = tracefs_synth_alloc(tep, "wakeup_lat",
213*287e80b3SSadaf Ebrahimi				    NULL, start_event,
214*287e80b3SSadaf Ebrahimi				    NULL, end_event,
215*287e80b3SSadaf Ebrahimi				    start_field, end_field,
216*287e80b3SSadaf Ebrahimi				    match_name);
217*287e80b3SSadaf Ebrahimi
218*287e80b3SSadaf Ebrahimi	/* The tep is no longer needed */
219*287e80b3SSadaf Ebrahimi	tep_free(tep);
220*287e80b3SSadaf Ebrahimi
221*287e80b3SSadaf Ebrahimi
222*287e80b3SSadaf Ebrahimi	/* Save the "prio" field as "prio" from the start event */
223*287e80b3SSadaf Ebrahimi	tracefs_synth_add_start_field(synth, "prio", NULL);
224*287e80b3SSadaf Ebrahimi
225*287e80b3SSadaf Ebrahimi	/* Save the "next_comm" as "comm" from the end event */
226*287e80b3SSadaf Ebrahimi	tracefs_synth_add_end_field(synth, "next_comm", "comm");
227*287e80b3SSadaf Ebrahimi
228*287e80b3SSadaf Ebrahimi	/* Save the "prev_prio" as "prev_prio" from the end event */
229*287e80b3SSadaf Ebrahimi	tracefs_synth_add_end_field(synth, "prev_prio", NULL);
230*287e80b3SSadaf Ebrahimi
231*287e80b3SSadaf Ebrahimi	/*
232*287e80b3SSadaf Ebrahimi	 * Take a microsecond time difference between end and start
233*287e80b3SSadaf Ebrahimi	 * and record as "delta"
234*287e80b3SSadaf Ebrahimi	 */
235*287e80b3SSadaf Ebrahimi	tracefs_synth_add_compare_field(synth, TRACEFS_TIMESTAMP_USECS,
236*287e80b3SSadaf Ebrahimi					TRACEFS_TIMESTAMP_USECS,
237*287e80b3SSadaf Ebrahimi					TRACEFS_SYNTH_DELTA_END, "delta");
238*287e80b3SSadaf Ebrahimi
239*287e80b3SSadaf Ebrahimi	/* Only record if start event "prio" is less than 100 */
240*287e80b3SSadaf Ebrahimi	tracefs_synth_append_start_filter(synth, TRACEFS_FILTER_COMPARE,
241*287e80b3SSadaf Ebrahimi					  "prio", TRACEFS_COMPARE_LT, "100");
242*287e80b3SSadaf Ebrahimi
243*287e80b3SSadaf Ebrahimi	/*
244*287e80b3SSadaf Ebrahimi	 * Only record if end event "next_prio" is less than 50
245*287e80b3SSadaf Ebrahimi	 * or the previous task's prio was not greater than or equal to 100.
246*287e80b3SSadaf Ebrahimi	 *   next_prio < 50 || !(prev_prio >= 100)
247*287e80b3SSadaf Ebrahimi	 */
248*287e80b3SSadaf Ebrahimi	tracefs_synth_append_end_filter(synth, TRACEFS_FILTER_COMPARE,
249*287e80b3SSadaf Ebrahimi					"next_prio", TRACEFS_COMPARE_LT, "50");
250*287e80b3SSadaf Ebrahimi	tracefs_synth_append_end_filter(synth, TRACEFS_FILTER_OR, NULL, 0, NULL);
251*287e80b3SSadaf Ebrahimi	tracefs_synth_append_end_filter(synth, TRACEFS_FILTER_NOT, NULL, 0, NULL);
252*287e80b3SSadaf Ebrahimi	tracefs_synth_append_end_filter(synth, TRACEFS_FILTER_OPEN_PAREN, NULL, 0, NULL);
253*287e80b3SSadaf Ebrahimi	tracefs_synth_append_end_filter(synth, TRACEFS_FILTER_COMPARE,
254*287e80b3SSadaf Ebrahimi					"prev_prio", TRACEFS_COMPARE_GE, "100");
255*287e80b3SSadaf Ebrahimi	/*
256*287e80b3SSadaf Ebrahimi	 * Note, the above only added: "next_prio < 50 || !(prev_prio >= 100"
257*287e80b3SSadaf Ebrahimi	 * That's because, when the synth is executed, the remaining close parenthesis
258*287e80b3SSadaf Ebrahimi	 * will be added. That is, the string will end up being:
259*287e80b3SSadaf Ebrahimi	 * "next_prio < 50 || !(prev_prio >= 100)" when one of tracefs_sync_create()
260*287e80b3SSadaf Ebrahimi	 * or tracefs_sync_echo_cmd() is run.
261*287e80b3SSadaf Ebrahimi	 */
262*287e80b3SSadaf Ebrahimi}
263*287e80b3SSadaf Ebrahimi
264*287e80b3SSadaf Ebrahimi/* Display how to create the synthetic event */
265*287e80b3SSadaf Ebrahimistatic void show_event(void)
266*287e80b3SSadaf Ebrahimi{
267*287e80b3SSadaf Ebrahimi	struct trace_seq s;
268*287e80b3SSadaf Ebrahimi
269*287e80b3SSadaf Ebrahimi	trace_seq_init(&s);
270*287e80b3SSadaf Ebrahimi
271*287e80b3SSadaf Ebrahimi	tracefs_synth_echo_cmd(&s, synth);
272*287e80b3SSadaf Ebrahimi	trace_seq_terminate(&s);
273*287e80b3SSadaf Ebrahimi	trace_seq_do_printf(&s);
274*287e80b3SSadaf Ebrahimi	trace_seq_destroy(&s);
275*287e80b3SSadaf Ebrahimi}
276*287e80b3SSadaf Ebrahimi
277*287e80b3SSadaf Ebrahimiint main (int argc, char **argv)
278*287e80b3SSadaf Ebrahimi{
279*287e80b3SSadaf Ebrahimi	make_event();
280*287e80b3SSadaf Ebrahimi
281*287e80b3SSadaf Ebrahimi	if (argc > 1) {
282*287e80b3SSadaf Ebrahimi		if (!strcmp(argv[1], "create")) {
283*287e80b3SSadaf Ebrahimi			/* Create the synthetic event */
284*287e80b3SSadaf Ebrahimi			tracefs_synth_create(synth);
285*287e80b3SSadaf Ebrahimi		} else if (!strcmp(argv[1], "delete")) {
286*287e80b3SSadaf Ebrahimi			/* Delete the synthetic event */
287*287e80b3SSadaf Ebrahimi			tracefs_synth_destroy(synth);
288*287e80b3SSadaf Ebrahimi		} else {
289*287e80b3SSadaf Ebrahimi			printf("usage: %s [create|delete]\n", argv[0]);
290*287e80b3SSadaf Ebrahimi			exit(-1);
291*287e80b3SSadaf Ebrahimi		}
292*287e80b3SSadaf Ebrahimi	} else
293*287e80b3SSadaf Ebrahimi		show_event();
294*287e80b3SSadaf Ebrahimi
295*287e80b3SSadaf Ebrahimi	tracefs_synth_free(synth);
296*287e80b3SSadaf Ebrahimi
297*287e80b3SSadaf Ebrahimi	return 0;
298*287e80b3SSadaf Ebrahimi}
299*287e80b3SSadaf Ebrahimi--
300*287e80b3SSadaf Ebrahimi
301*287e80b3SSadaf EbrahimiFILES
302*287e80b3SSadaf Ebrahimi-----
303*287e80b3SSadaf Ebrahimi[verse]
304*287e80b3SSadaf Ebrahimi--
305*287e80b3SSadaf Ebrahimi*tracefs.h*
306*287e80b3SSadaf Ebrahimi	Header file to include in order to have access to the library APIs.
307*287e80b3SSadaf Ebrahimi*-ltracefs*
308*287e80b3SSadaf Ebrahimi	Linker switch to add when building a program that uses the library.
309*287e80b3SSadaf Ebrahimi--
310*287e80b3SSadaf Ebrahimi
311*287e80b3SSadaf EbrahimiSEE ALSO
312*287e80b3SSadaf Ebrahimi--------
313*287e80b3SSadaf Ebrahimi*tracefs_synth_create*(3),
314*287e80b3SSadaf Ebrahimi*tracefs_synth_destroy*(3),
315*287e80b3SSadaf Ebrahimi*tracfes_synth_echo_cmd*(3),
316*287e80b3SSadaf Ebrahimi*libtracefs*(3),
317*287e80b3SSadaf Ebrahimi*libtraceevent*(3),
318*287e80b3SSadaf Ebrahimi*trace-cmd*(1),
319*287e80b3SSadaf Ebrahimi*tracefs_hist_alloc*(3),
320*287e80b3SSadaf Ebrahimi*tracefs_hist_alloc_2d*(3),
321*287e80b3SSadaf Ebrahimi*tracefs_hist_alloc_nd*(3),
322*287e80b3SSadaf Ebrahimi*tracefs_hist_free*(3),
323*287e80b3SSadaf Ebrahimi*tracefs_hist_add_key*(3),
324*287e80b3SSadaf Ebrahimi*tracefs_hist_add_value*(3),
325*287e80b3SSadaf Ebrahimi*tracefs_hist_add_name*(3),
326*287e80b3SSadaf Ebrahimi*tracefs_hist_start*(3),
327*287e80b3SSadaf Ebrahimi*tracefs_hist_destory*(3),
328*287e80b3SSadaf Ebrahimi*tracefs_hist_add_sort_key*(3),
329*287e80b3SSadaf Ebrahimi*tracefs_hist_sort_key_direction*(3),
330*287e80b3SSadaf Ebrahimi*tracefs_synth_create*(3),
331*287e80b3SSadaf Ebrahimi*tracefs_synth_destroy*(3),
332*287e80b3SSadaf Ebrahimi*tracefs_synth_complete*(3),
333*287e80b3SSadaf Ebrahimi*tracefs_synth_trace*(3),
334*287e80b3SSadaf Ebrahimi*tracefs_synth_snapshot*(3),
335*287e80b3SSadaf Ebrahimi*tracefs_synth_save*(3),
336*287e80b3SSadaf Ebrahimi*tracefs_synth_echo_cmd*(3),
337*287e80b3SSadaf Ebrahimi*tracefs_synth_get_start_hist*(3),
338*287e80b3SSadaf Ebrahimi*tracefs_synth_get_name*(3),
339*287e80b3SSadaf Ebrahimi*tracefs_synth_raw_fmt*(3),
340*287e80b3SSadaf Ebrahimi*tracefs_synth_show_event*(3),
341*287e80b3SSadaf Ebrahimi*tracefs_synth_show_start_hist*(3),
342*287e80b3SSadaf Ebrahimi*tracefs_synth_show_end_hist*(3),
343*287e80b3SSadaf Ebrahimi*tracefs_synth_get_event*(3),
344*287e80b3SSadaf Ebrahimi
345*287e80b3SSadaf EbrahimiAUTHOR
346*287e80b3SSadaf Ebrahimi------
347*287e80b3SSadaf Ebrahimi[verse]
348*287e80b3SSadaf Ebrahimi--
349*287e80b3SSadaf Ebrahimi*Steven Rostedt* <[email protected]>
350*287e80b3SSadaf Ebrahimi*Tzvetomir Stoyanov* <[email protected]>
351*287e80b3SSadaf Ebrahimi*sameeruddin shaik* <[email protected]>
352*287e80b3SSadaf Ebrahimi--
353*287e80b3SSadaf EbrahimiREPORTING BUGS
354*287e80b3SSadaf Ebrahimi--------------
355*287e80b3SSadaf EbrahimiReport bugs to  <[email protected]>
356*287e80b3SSadaf Ebrahimi
357*287e80b3SSadaf EbrahimiLICENSE
358*287e80b3SSadaf Ebrahimi-------
359*287e80b3SSadaf Ebrahimilibtracefs is Free Software licensed under the GNU LGPL 2.1
360*287e80b3SSadaf Ebrahimi
361*287e80b3SSadaf EbrahimiRESOURCES
362*287e80b3SSadaf Ebrahimi---------
363*287e80b3SSadaf Ebrahimihttps://git.kernel.org/pub/scm/libs/libtrace/libtracefs.git/
364*287e80b3SSadaf Ebrahimi
365*287e80b3SSadaf EbrahimiCOPYING
366*287e80b3SSadaf Ebrahimi-------
367*287e80b3SSadaf EbrahimiCopyright \(C) 2020 VMware, Inc. Free use of this software is granted under
368*287e80b3SSadaf Ebrahimithe terms of the GNU Public License (GPL).
369