diff options
author | Tzvetomir Stoyanov <tstoyanov@vmware.com> | 2019-04-01 12:43:17 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-04-01 14:18:09 -0400 |
commit | 047ff221e3ab07129a3566683e95a4d142f7c3c0 (patch) | |
tree | a2b418b16093087103167f39dea31fede2c2cb18 /tools/lib/traceevent/event-parse-api.c | |
parent | 55c34ae076f62ed7ad0fc86cd8b697a6f577c431 (diff) |
tools lib traceevent: Rename input arguments of libtraceevent APIs from pevent to tep
Input arguments of libtraceevent APIs are renamed from "struct
tep_handle *pevent" to "struct tep_handle *tep". This makes the API
consistent with the chosen naming convention: tep (trace event parser),
instead of the old pevent.
Signed-off-by: Tzvetomir Stoyanov <tstoyanov@vmware.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/linux-trace-devel/20190401132111.13727-2-tstoyanov@vmware.com
Link: http://lkml.kernel.org/r/20190401164344.465573837@goodmis.org
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/lib/traceevent/event-parse-api.c')
-rw-r--r-- | tools/lib/traceevent/event-parse-api.c | 132 |
1 files changed, 66 insertions, 66 deletions
diff --git a/tools/lib/traceevent/event-parse-api.c b/tools/lib/traceevent/event-parse-api.c index f7184575f0d9..988587840c80 100644 --- a/tools/lib/traceevent/event-parse-api.c +++ b/tools/lib/traceevent/event-parse-api.c | |||
@@ -92,11 +92,11 @@ bool tep_test_flag(struct tep_handle *tep, enum tep_flag flag) | |||
92 | return false; | 92 | return false; |
93 | } | 93 | } |
94 | 94 | ||
95 | unsigned short tep_data2host2(struct tep_handle *pevent, unsigned short data) | 95 | unsigned short tep_data2host2(struct tep_handle *tep, unsigned short data) |
96 | { | 96 | { |
97 | unsigned short swap; | 97 | unsigned short swap; |
98 | 98 | ||
99 | if (!pevent || pevent->host_bigendian == pevent->file_bigendian) | 99 | if (!tep || tep->host_bigendian == tep->file_bigendian) |
100 | return data; | 100 | return data; |
101 | 101 | ||
102 | swap = ((data & 0xffULL) << 8) | | 102 | swap = ((data & 0xffULL) << 8) | |
@@ -105,11 +105,11 @@ unsigned short tep_data2host2(struct tep_handle *pevent, unsigned short data) | |||
105 | return swap; | 105 | return swap; |
106 | } | 106 | } |
107 | 107 | ||
108 | unsigned int tep_data2host4(struct tep_handle *pevent, unsigned int data) | 108 | unsigned int tep_data2host4(struct tep_handle *tep, unsigned int data) |
109 | { | 109 | { |
110 | unsigned int swap; | 110 | unsigned int swap; |
111 | 111 | ||
112 | if (!pevent || pevent->host_bigendian == pevent->file_bigendian) | 112 | if (!tep || tep->host_bigendian == tep->file_bigendian) |
113 | return data; | 113 | return data; |
114 | 114 | ||
115 | swap = ((data & 0xffULL) << 24) | | 115 | swap = ((data & 0xffULL) << 24) | |
@@ -121,11 +121,11 @@ unsigned int tep_data2host4(struct tep_handle *pevent, unsigned int data) | |||
121 | } | 121 | } |
122 | 122 | ||
123 | unsigned long long | 123 | unsigned long long |
124 | tep_data2host8(struct tep_handle *pevent, unsigned long long data) | 124 | tep_data2host8(struct tep_handle *tep, unsigned long long data) |
125 | { | 125 | { |
126 | unsigned long long swap; | 126 | unsigned long long swap; |
127 | 127 | ||
128 | if (!pevent || pevent->host_bigendian == pevent->file_bigendian) | 128 | if (!tep || tep->host_bigendian == tep->file_bigendian) |
129 | return data; | 129 | return data; |
130 | 130 | ||
131 | swap = ((data & 0xffULL) << 56) | | 131 | swap = ((data & 0xffULL) << 56) | |
@@ -142,15 +142,15 @@ tep_data2host8(struct tep_handle *pevent, unsigned long long data) | |||
142 | 142 | ||
143 | /** | 143 | /** |
144 | * tep_get_header_page_size - get size of the header page | 144 | * tep_get_header_page_size - get size of the header page |
145 | * @pevent: a handle to the tep_handle | 145 | * @tep: a handle to the tep_handle |
146 | * | 146 | * |
147 | * This returns size of the header page | 147 | * This returns size of the header page |
148 | * If @pevent is NULL, 0 is returned. | 148 | * If @tep is NULL, 0 is returned. |
149 | */ | 149 | */ |
150 | int tep_get_header_page_size(struct tep_handle *pevent) | 150 | int tep_get_header_page_size(struct tep_handle *tep) |
151 | { | 151 | { |
152 | if (pevent) | 152 | if (tep) |
153 | return pevent->header_page_size_size; | 153 | return tep->header_page_size_size; |
154 | return 0; | 154 | return 0; |
155 | } | 155 | } |
156 | 156 | ||
@@ -170,163 +170,163 @@ int tep_get_header_timestamp_size(struct tep_handle *tep) | |||
170 | 170 | ||
171 | /** | 171 | /** |
172 | * tep_get_cpus - get the number of CPUs | 172 | * tep_get_cpus - get the number of CPUs |
173 | * @pevent: a handle to the tep_handle | 173 | * @tep: a handle to the tep_handle |
174 | * | 174 | * |
175 | * This returns the number of CPUs | 175 | * This returns the number of CPUs |
176 | * If @pevent is NULL, 0 is returned. | 176 | * If @tep is NULL, 0 is returned. |
177 | */ | 177 | */ |
178 | int tep_get_cpus(struct tep_handle *pevent) | 178 | int tep_get_cpus(struct tep_handle *tep) |
179 | { | 179 | { |
180 | if (pevent) | 180 | if (tep) |
181 | return pevent->cpus; | 181 | return tep->cpus; |
182 | return 0; | 182 | return 0; |
183 | } | 183 | } |
184 | 184 | ||
185 | /** | 185 | /** |
186 | * tep_set_cpus - set the number of CPUs | 186 | * tep_set_cpus - set the number of CPUs |
187 | * @pevent: a handle to the tep_handle | 187 | * @tep: a handle to the tep_handle |
188 | * | 188 | * |
189 | * This sets the number of CPUs | 189 | * This sets the number of CPUs |
190 | */ | 190 | */ |
191 | void tep_set_cpus(struct tep_handle *pevent, int cpus) | 191 | void tep_set_cpus(struct tep_handle *tep, int cpus) |
192 | { | 192 | { |
193 | if (pevent) | 193 | if (tep) |
194 | pevent->cpus = cpus; | 194 | tep->cpus = cpus; |
195 | } | 195 | } |
196 | 196 | ||
197 | /** | 197 | /** |
198 | * tep_get_long_size - get the size of a long integer on the traced machine | 198 | * tep_get_long_size - get the size of a long integer on the traced machine |
199 | * @pevent: a handle to the tep_handle | 199 | * @tep: a handle to the tep_handle |
200 | * | 200 | * |
201 | * This returns the size of a long integer on the traced machine | 201 | * This returns the size of a long integer on the traced machine |
202 | * If @pevent is NULL, 0 is returned. | 202 | * If @tep is NULL, 0 is returned. |
203 | */ | 203 | */ |
204 | int tep_get_long_size(struct tep_handle *pevent) | 204 | int tep_get_long_size(struct tep_handle *tep) |
205 | { | 205 | { |
206 | if (pevent) | 206 | if (tep) |
207 | return pevent->long_size; | 207 | return tep->long_size; |
208 | return 0; | 208 | return 0; |
209 | } | 209 | } |
210 | 210 | ||
211 | /** | 211 | /** |
212 | * tep_set_long_size - set the size of a long integer on the traced machine | 212 | * tep_set_long_size - set the size of a long integer on the traced machine |
213 | * @pevent: a handle to the tep_handle | 213 | * @tep: a handle to the tep_handle |
214 | * @size: size, in bytes, of a long integer | 214 | * @size: size, in bytes, of a long integer |
215 | * | 215 | * |
216 | * This sets the size of a long integer on the traced machine | 216 | * This sets the size of a long integer on the traced machine |
217 | */ | 217 | */ |
218 | void tep_set_long_size(struct tep_handle *pevent, int long_size) | 218 | void tep_set_long_size(struct tep_handle *tep, int long_size) |
219 | { | 219 | { |
220 | if (pevent) | 220 | if (tep) |
221 | pevent->long_size = long_size; | 221 | tep->long_size = long_size; |
222 | } | 222 | } |
223 | 223 | ||
224 | /** | 224 | /** |
225 | * tep_get_page_size - get the size of a memory page on the traced machine | 225 | * tep_get_page_size - get the size of a memory page on the traced machine |
226 | * @pevent: a handle to the tep_handle | 226 | * @tep: a handle to the tep_handle |
227 | * | 227 | * |
228 | * This returns the size of a memory page on the traced machine | 228 | * This returns the size of a memory page on the traced machine |
229 | * If @pevent is NULL, 0 is returned. | 229 | * If @tep is NULL, 0 is returned. |
230 | */ | 230 | */ |
231 | int tep_get_page_size(struct tep_handle *pevent) | 231 | int tep_get_page_size(struct tep_handle *tep) |
232 | { | 232 | { |
233 | if (pevent) | 233 | if (tep) |
234 | return pevent->page_size; | 234 | return tep->page_size; |
235 | return 0; | 235 | return 0; |
236 | } | 236 | } |
237 | 237 | ||
238 | /** | 238 | /** |
239 | * tep_set_page_size - set the size of a memory page on the traced machine | 239 | * tep_set_page_size - set the size of a memory page on the traced machine |
240 | * @pevent: a handle to the tep_handle | 240 | * @tep: a handle to the tep_handle |
241 | * @_page_size: size of a memory page, in bytes | 241 | * @_page_size: size of a memory page, in bytes |
242 | * | 242 | * |
243 | * This sets the size of a memory page on the traced machine | 243 | * This sets the size of a memory page on the traced machine |
244 | */ | 244 | */ |
245 | void tep_set_page_size(struct tep_handle *pevent, int _page_size) | 245 | void tep_set_page_size(struct tep_handle *tep, int _page_size) |
246 | { | 246 | { |
247 | if (pevent) | 247 | if (tep) |
248 | pevent->page_size = _page_size; | 248 | tep->page_size = _page_size; |
249 | } | 249 | } |
250 | 250 | ||
251 | /** | 251 | /** |
252 | * tep_is_file_bigendian - return the endian of the file | 252 | * tep_is_file_bigendian - return the endian of the file |
253 | * @pevent: a handle to the tep_handle | 253 | * @tep: a handle to the tep_handle |
254 | * | 254 | * |
255 | * This returns true if the file is in big endian order | 255 | * This returns true if the file is in big endian order |
256 | * If @pevent is NULL, false is returned. | 256 | * If @tep is NULL, false is returned. |
257 | */ | 257 | */ |
258 | bool tep_is_file_bigendian(struct tep_handle *pevent) | 258 | bool tep_is_file_bigendian(struct tep_handle *tep) |
259 | { | 259 | { |
260 | if (pevent) | 260 | if (tep) |
261 | return pevent->file_bigendian == TEP_BIG_ENDIAN; | 261 | return (tep->file_bigendian == TEP_BIG_ENDIAN); |
262 | return false; | 262 | return false; |
263 | } | 263 | } |
264 | 264 | ||
265 | /** | 265 | /** |
266 | * tep_set_file_bigendian - set if the file is in big endian order | 266 | * tep_set_file_bigendian - set if the file is in big endian order |
267 | * @pevent: a handle to the tep_handle | 267 | * @tep: a handle to the tep_handle |
268 | * @endian: non zero, if the file is in big endian order | 268 | * @endian: non zero, if the file is in big endian order |
269 | * | 269 | * |
270 | * This sets if the file is in big endian order | 270 | * This sets if the file is in big endian order |
271 | */ | 271 | */ |
272 | void tep_set_file_bigendian(struct tep_handle *pevent, enum tep_endian endian) | 272 | void tep_set_file_bigendian(struct tep_handle *tep, enum tep_endian endian) |
273 | { | 273 | { |
274 | if (pevent) | 274 | if (tep) |
275 | pevent->file_bigendian = endian; | 275 | tep->file_bigendian = endian; |
276 | } | 276 | } |
277 | 277 | ||
278 | /** | 278 | /** |
279 | * tep_is_local_bigendian - return the endian of the saved local machine | 279 | * tep_is_local_bigendian - return the endian of the saved local machine |
280 | * @pevent: a handle to the tep_handle | 280 | * @tep: a handle to the tep_handle |
281 | * | 281 | * |
282 | * This returns true if the saved local machine in @pevent is big endian. | 282 | * This returns true if the saved local machine in @tep is big endian. |
283 | * If @pevent is NULL, false is returned. | 283 | * If @tep is NULL, false is returned. |
284 | */ | 284 | */ |
285 | bool tep_is_local_bigendian(struct tep_handle *pevent) | 285 | bool tep_is_local_bigendian(struct tep_handle *tep) |
286 | { | 286 | { |
287 | if (pevent) | 287 | if (tep) |
288 | return pevent->host_bigendian == TEP_BIG_ENDIAN; | 288 | return (tep->host_bigendian == TEP_BIG_ENDIAN); |
289 | return 0; | 289 | return 0; |
290 | } | 290 | } |
291 | 291 | ||
292 | /** | 292 | /** |
293 | * tep_set_local_bigendian - set the stored local machine endian order | 293 | * tep_set_local_bigendian - set the stored local machine endian order |
294 | * @pevent: a handle to the tep_handle | 294 | * @tep: a handle to the tep_handle |
295 | * @endian: non zero, if the local host has big endian order | 295 | * @endian: non zero, if the local host has big endian order |
296 | * | 296 | * |
297 | * This sets the endian order for the local machine. | 297 | * This sets the endian order for the local machine. |
298 | */ | 298 | */ |
299 | void tep_set_local_bigendian(struct tep_handle *pevent, enum tep_endian endian) | 299 | void tep_set_local_bigendian(struct tep_handle *tep, enum tep_endian endian) |
300 | { | 300 | { |
301 | if (pevent) | 301 | if (tep) |
302 | pevent->host_bigendian = endian; | 302 | tep->host_bigendian = endian; |
303 | } | 303 | } |
304 | 304 | ||
305 | /** | 305 | /** |
306 | * tep_is_latency_format - get if the latency output format is configured | 306 | * tep_is_latency_format - get if the latency output format is configured |
307 | * @pevent: a handle to the tep_handle | 307 | * @tep: a handle to the tep_handle |
308 | * | 308 | * |
309 | * This returns true if the latency output format is configured | 309 | * This returns true if the latency output format is configured |
310 | * If @pevent is NULL, false is returned. | 310 | * If @tep is NULL, false is returned. |
311 | */ | 311 | */ |
312 | bool tep_is_latency_format(struct tep_handle *pevent) | 312 | bool tep_is_latency_format(struct tep_handle *tep) |
313 | { | 313 | { |
314 | if (pevent) | 314 | if (tep) |
315 | return pevent->latency_format; | 315 | return (tep->latency_format); |
316 | return false; | 316 | return false; |
317 | } | 317 | } |
318 | 318 | ||
319 | /** | 319 | /** |
320 | * tep_set_latency_format - set the latency output format | 320 | * tep_set_latency_format - set the latency output format |
321 | * @pevent: a handle to the tep_handle | 321 | * @tep: a handle to the tep_handle |
322 | * @lat: non zero for latency output format | 322 | * @lat: non zero for latency output format |
323 | * | 323 | * |
324 | * This sets the latency output format | 324 | * This sets the latency output format |
325 | */ | 325 | */ |
326 | void tep_set_latency_format(struct tep_handle *pevent, int lat) | 326 | void tep_set_latency_format(struct tep_handle *tep, int lat) |
327 | { | 327 | { |
328 | if (pevent) | 328 | if (tep) |
329 | pevent->latency_format = lat; | 329 | tep->latency_format = lat; |
330 | } | 330 | } |
331 | 331 | ||
332 | /** | 332 | /** |