Debian Codegraph @

examples/barectf-tracepoint/tp.h

raw
1 #undef TRACEPOINT_PROVIDER
2 #define TRACEPOINT_PROVIDER barectf_tp
3
4 #undef TRACEPOINT_INCLUDE
5 #define TRACEPOINT_INCLUDE "./tp.h"
6
7 #if !defined(_TP_H) || defined(TRACEPOINT_HEADER_MULTI_READ)
8 #define _TP_H
9
10 /*
11 * The MIT License (MIT)
12 *
13 * Copyright (c) 2016 Philippe Proulx <[email protected]>
14 *
15 * Permission is hereby granted, free of charge, to any person obtaining a copy
16 * of this software and associated documentation files (the "Software"), to deal
17 * in the Software without restriction, including without limitation the rights
18 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
19 * copies of the Software, and to permit persons to whom the Software is
20 * furnished to do so, subject to the following conditions:
21 *
22 * The above copyright notice and this permission notice shall be included in
23 * all copies or substantial portions of the Software.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
26 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
28 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
30 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
31 * THE SOFTWARE.
32 */
33
34 #include <lttng/tracepoint.h>
35 #include <stdint.h>
36
37 TRACEPOINT_EVENT(
38 barectf_tp,
39 simple_uint32,
40 TP_ARGS(
41 uint32_t, value
42 ),
43 TP_FIELDS(
44 ctf_integer(uint32_t, value, value)
45 )
46 )
47
48 TRACEPOINT_LOGLEVEL(barectf_tp, simple_uint32, TRACE_CRIT)
49
50 TRACEPOINT_EVENT(
51 barectf_tp,
52 simple_int16,
53 TP_ARGS(
54 int16_t, value
55 ),
56 TP_FIELDS(
57 ctf_integer(int16_t, value, value)
58 )
59 )
60
61 TRACEPOINT_EVENT(
62 barectf_tp,
63 simple_float,
64 TP_ARGS(
65 float, value
66 ),
67 TP_FIELDS(
68 ctf_float(float, value, value)
69 )
70 )
71
72 TRACEPOINT_EVENT(
73 barectf_tp,
74 simple_string,
75 TP_ARGS(
76 const char *, value
77 ),
78 TP_FIELDS(
79 ctf_string(value, value)
80 )
81 )
82
83 TRACEPOINT_LOGLEVEL(barectf_tp, simple_string, TRACE_WARNING)
84
85 TRACEPOINT_ENUM(
86 barectf_tp,
87 state,
88 TP_ENUM_VALUES(
89 ctf_enum_value("NEW", 0)
90 ctf_enum_value("TERMINATED", 1)
91 ctf_enum_value("READY", 2)
92 ctf_enum_value("RUNNING", 3)
93 ctf_enum_value("WAITING", 4)
94 )
95 )
96
97 TRACEPOINT_EVENT(
98 barectf_tp,
99 simple_enum,
100 TP_ARGS(
101 int, value
102 ),
103 TP_FIELDS(
104 ctf_enum(barectf_tp, state, int, value, value)
105 )
106 )
107
108 TRACEPOINT_EVENT(
109 barectf_tp,
110 a_few_fields,
111 TP_ARGS(
112 int32_t, int32,
113 uint16_t, int16,
114 double, dbl,
115 const char *, str,
116 int, state
117 ),
118 TP_FIELDS(
119 ctf_integer(int32_t, int32, int32)
120 ctf_integer(int16_t, int16, int16)
121 ctf_float(double, dbl, dbl)
122 ctf_string(str, str)
123 ctf_enum(barectf_tp, state, int, state, state)
124 )
125 )
126
127 TRACEPOINT_EVENT(
128 barectf_tp,
129 bit_packed_integers,
130 TP_ARGS(
131 uint8_t, uint1,
132 int8_t, int1,
133 uint8_t, uint2,
134 int8_t, int3,
135 uint8_t, uint4,
136 int8_t, int5,
137 uint8_t, uint6,
138 int8_t, int7,
139 uint8_t, uint8
140 ),
141 TP_FIELDS(
142 ctf_integer(uint8_t, uint1, uint1)
143 ctf_integer(int8_t, int1, int1)
144 ctf_integer(uint8_t, uint2, uint2)
145 ctf_integer(int8_t, int3, int3)
146 ctf_integer(uint8_t, uint4, uint4)
147 ctf_integer(int8_t, int5, int5)
148 ctf_integer(uint8_t, uint6, uint6)
149 ctf_integer(int8_t, int7, int7)
150 ctf_integer(uint8_t, uint8, uint8)
151 )
152 )
153
154 TRACEPOINT_LOGLEVEL(barectf_tp, bit_packed_integers, 513)
155
156 #endif /* _TP_H */
157
158 #include <lttng/tracepoint-event.h>