diff options
Diffstat (limited to 'include/trace/events/nvhost.h')
-rw-r--r-- | include/trace/events/nvhost.h | 438 |
1 files changed, 438 insertions, 0 deletions
diff --git a/include/trace/events/nvhost.h b/include/trace/events/nvhost.h new file mode 100644 index 00000000000..4c44cdc99f9 --- /dev/null +++ b/include/trace/events/nvhost.h | |||
@@ -0,0 +1,438 @@ | |||
1 | /* | ||
2 | * include/trace/events/nvhost.h | ||
3 | * | ||
4 | * Nvhost event logging to ftrace. | ||
5 | * | ||
6 | * Copyright (c) 2010-2012, NVIDIA Corporation. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
16 | * more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along | ||
19 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
21 | */ | ||
22 | |||
23 | #undef TRACE_SYSTEM | ||
24 | #define TRACE_SYSTEM nvhost | ||
25 | |||
26 | #if !defined(_TRACE_NVHOST_H) || defined(TRACE_HEADER_MULTI_READ) | ||
27 | #define _TRACE_NVHOST_H | ||
28 | |||
29 | #include <linux/ktime.h> | ||
30 | #include <linux/tracepoint.h> | ||
31 | |||
32 | DECLARE_EVENT_CLASS(nvhost, | ||
33 | TP_PROTO(const char *name), | ||
34 | TP_ARGS(name), | ||
35 | TP_STRUCT__entry(__field(const char *, name)), | ||
36 | TP_fast_assign(__entry->name = name;), | ||
37 | TP_printk("name=%s", __entry->name) | ||
38 | ); | ||
39 | |||
40 | DEFINE_EVENT(nvhost, nvhost_channel_open, | ||
41 | TP_PROTO(const char *name), | ||
42 | TP_ARGS(name) | ||
43 | ); | ||
44 | |||
45 | DEFINE_EVENT(nvhost, nvhost_channel_release, | ||
46 | TP_PROTO(const char *name), | ||
47 | TP_ARGS(name) | ||
48 | ); | ||
49 | |||
50 | DEFINE_EVENT(nvhost, nvhost_ioctl_channel_flush, | ||
51 | TP_PROTO(const char *name), | ||
52 | TP_ARGS(name) | ||
53 | ); | ||
54 | |||
55 | TRACE_EVENT(nvhost_channel_write_submit, | ||
56 | TP_PROTO(const char *name, ssize_t count, u32 cmdbufs, u32 relocs, | ||
57 | u32 syncpt_id, u32 syncpt_incrs), | ||
58 | |||
59 | TP_ARGS(name, count, cmdbufs, relocs, syncpt_id, syncpt_incrs), | ||
60 | |||
61 | TP_STRUCT__entry( | ||
62 | __field(const char *, name) | ||
63 | __field(ssize_t, count) | ||
64 | __field(u32, cmdbufs) | ||
65 | __field(u32, relocs) | ||
66 | __field(u32, syncpt_id) | ||
67 | __field(u32, syncpt_incrs) | ||
68 | ), | ||
69 | |||
70 | TP_fast_assign( | ||
71 | __entry->name = name; | ||
72 | __entry->count = count; | ||
73 | __entry->cmdbufs = cmdbufs; | ||
74 | __entry->relocs = relocs; | ||
75 | __entry->syncpt_id = syncpt_id; | ||
76 | __entry->syncpt_incrs = syncpt_incrs; | ||
77 | ), | ||
78 | |||
79 | TP_printk("name=%s, count=%d, cmdbufs=%u, relocs=%u, syncpt_id=%u, syncpt_incrs=%u", | ||
80 | __entry->name, __entry->count, __entry->cmdbufs, __entry->relocs, | ||
81 | __entry->syncpt_id, __entry->syncpt_incrs) | ||
82 | ); | ||
83 | |||
84 | TRACE_EVENT(nvhost_ioctl_channel_submit, | ||
85 | TP_PROTO(const char *name, u32 version, u32 cmdbufs, u32 relocs, | ||
86 | u32 waitchks, u32 syncpt_id, u32 syncpt_incrs), | ||
87 | |||
88 | TP_ARGS(name, version, cmdbufs, relocs, waitchks, | ||
89 | syncpt_id, syncpt_incrs), | ||
90 | |||
91 | TP_STRUCT__entry( | ||
92 | __field(const char *, name) | ||
93 | __field(u32, version) | ||
94 | __field(u32, cmdbufs) | ||
95 | __field(u32, relocs) | ||
96 | __field(u32, waitchks) | ||
97 | __field(u32, syncpt_id) | ||
98 | __field(u32, syncpt_incrs) | ||
99 | ), | ||
100 | |||
101 | TP_fast_assign( | ||
102 | __entry->name = name; | ||
103 | __entry->version = version; | ||
104 | __entry->cmdbufs = cmdbufs; | ||
105 | __entry->relocs = relocs; | ||
106 | __entry->waitchks = waitchks; | ||
107 | __entry->syncpt_id = syncpt_id; | ||
108 | __entry->syncpt_incrs = syncpt_incrs; | ||
109 | ), | ||
110 | |||
111 | TP_printk("name=%s, version=%u, cmdbufs=%u, relocs=%u, waitchks=%u, syncpt_id=%u, syncpt_incrs=%u", | ||
112 | __entry->name, __entry->version, __entry->cmdbufs, __entry->relocs, | ||
113 | __entry->waitchks, __entry->syncpt_id, __entry->syncpt_incrs) | ||
114 | ); | ||
115 | |||
116 | TRACE_EVENT(nvhost_channel_write_cmdbuf, | ||
117 | TP_PROTO(const char *name, u32 mem_id, | ||
118 | u32 words, u32 offset), | ||
119 | |||
120 | TP_ARGS(name, mem_id, words, offset), | ||
121 | |||
122 | TP_STRUCT__entry( | ||
123 | __field(const char *, name) | ||
124 | __field(u32, mem_id) | ||
125 | __field(u32, words) | ||
126 | __field(u32, offset) | ||
127 | ), | ||
128 | |||
129 | TP_fast_assign( | ||
130 | __entry->name = name; | ||
131 | __entry->mem_id = mem_id; | ||
132 | __entry->words = words; | ||
133 | __entry->offset = offset; | ||
134 | ), | ||
135 | |||
136 | TP_printk("name=%s, mem_id=%08x, words=%u, offset=%d", | ||
137 | __entry->name, __entry->mem_id, | ||
138 | __entry->words, __entry->offset) | ||
139 | ); | ||
140 | |||
141 | TRACE_EVENT(nvhost_channel_write_cmdbuf_data, | ||
142 | TP_PROTO(const char *name, u32 mem_id, | ||
143 | u32 words, u32 offset, void *cmdbuf), | ||
144 | |||
145 | TP_ARGS(name, mem_id, words, offset, cmdbuf), | ||
146 | |||
147 | TP_STRUCT__entry( | ||
148 | __field(const char *, name) | ||
149 | __field(u32, mem_id) | ||
150 | __field(u32, words) | ||
151 | __field(u32, offset) | ||
152 | __field(bool, cmdbuf) | ||
153 | __dynamic_array(u32, cmdbuf, words) | ||
154 | ), | ||
155 | |||
156 | TP_fast_assign( | ||
157 | if (cmdbuf) { | ||
158 | memcpy(__get_dynamic_array(cmdbuf), cmdbuf+offset, | ||
159 | words * sizeof(u32)); | ||
160 | } | ||
161 | __entry->cmdbuf = cmdbuf; | ||
162 | __entry->name = name; | ||
163 | __entry->mem_id = mem_id; | ||
164 | __entry->words = words; | ||
165 | __entry->offset = offset; | ||
166 | ), | ||
167 | |||
168 | TP_printk("name=%s, mem_id=%08x, words=%u, offset=%d, contents=[%s]", | ||
169 | __entry->name, __entry->mem_id, | ||
170 | __entry->words, __entry->offset, | ||
171 | __print_hex(__get_dynamic_array(cmdbuf), | ||
172 | __entry->cmdbuf ? __entry->words * 4 : 0)) | ||
173 | ); | ||
174 | |||
175 | TRACE_EVENT(nvhost_channel_write_reloc, | ||
176 | TP_PROTO(const char *name), | ||
177 | |||
178 | TP_ARGS(name), | ||
179 | |||
180 | TP_STRUCT__entry( | ||
181 | __field(const char *, name) | ||
182 | ), | ||
183 | |||
184 | TP_fast_assign( | ||
185 | __entry->name = name; | ||
186 | ), | ||
187 | |||
188 | TP_printk("name=%s", | ||
189 | __entry->name) | ||
190 | ); | ||
191 | |||
192 | TRACE_EVENT(nvhost_channel_write_waitchks, | ||
193 | TP_PROTO(const char *name, u32 waitchks, u32 waitmask), | ||
194 | |||
195 | TP_ARGS(name, waitchks, waitmask), | ||
196 | |||
197 | TP_STRUCT__entry( | ||
198 | __field(const char *, name) | ||
199 | __field(u32, waitchks) | ||
200 | __field(u32, waitmask) | ||
201 | ), | ||
202 | |||
203 | TP_fast_assign( | ||
204 | __entry->name = name; | ||
205 | __entry->waitchks = waitchks; | ||
206 | __entry->waitmask = waitmask; | ||
207 | ), | ||
208 | |||
209 | TP_printk("name=%s, waitchks=%u, waitmask=%08x", | ||
210 | __entry->name, __entry->waitchks, __entry->waitmask) | ||
211 | ); | ||
212 | |||
213 | TRACE_EVENT(nvhost_channel_context_save, | ||
214 | TP_PROTO(const char *name, void *ctx), | ||
215 | |||
216 | TP_ARGS(name, ctx), | ||
217 | |||
218 | TP_STRUCT__entry( | ||
219 | __field(const char *, name) | ||
220 | __field(void*, ctx) | ||
221 | ), | ||
222 | |||
223 | TP_fast_assign( | ||
224 | __entry->name = name; | ||
225 | __entry->ctx = ctx; | ||
226 | ), | ||
227 | |||
228 | TP_printk("name=%s, ctx=%p", | ||
229 | __entry->name, __entry->ctx) | ||
230 | ); | ||
231 | |||
232 | TRACE_EVENT(nvhost_channel_context_restore, | ||
233 | TP_PROTO(const char *name, void *ctx), | ||
234 | |||
235 | TP_ARGS(name, ctx), | ||
236 | |||
237 | TP_STRUCT__entry( | ||
238 | __field(const char *, name) | ||
239 | __field(void*, ctx) | ||
240 | ), | ||
241 | |||
242 | TP_fast_assign( | ||
243 | __entry->name = name; | ||
244 | __entry->ctx = ctx; | ||
245 | ), | ||
246 | |||
247 | TP_printk("name=%s, ctx=%p", | ||
248 | __entry->name, __entry->ctx) | ||
249 | ); | ||
250 | |||
251 | TRACE_EVENT(nvhost_ctrlopen, | ||
252 | TP_PROTO(const char *name), | ||
253 | TP_ARGS(name), | ||
254 | TP_STRUCT__entry( | ||
255 | __field(const char *, name) | ||
256 | ), | ||
257 | TP_fast_assign( | ||
258 | __entry->name = name | ||
259 | ), | ||
260 | TP_printk("name=%s", __entry->name) | ||
261 | ); | ||
262 | |||
263 | TRACE_EVENT(nvhost_ctrlrelease, | ||
264 | TP_PROTO(const char *name), | ||
265 | TP_ARGS(name), | ||
266 | TP_STRUCT__entry( | ||
267 | __field(const char *, name) | ||
268 | ), | ||
269 | TP_fast_assign( | ||
270 | __entry->name = name | ||
271 | ), | ||
272 | TP_printk("name=%s", __entry->name) | ||
273 | ); | ||
274 | |||
275 | TRACE_EVENT(nvhost_ioctl_ctrl_module_mutex, | ||
276 | TP_PROTO(u32 lock, u32 id), | ||
277 | |||
278 | TP_ARGS(lock, id), | ||
279 | |||
280 | TP_STRUCT__entry( | ||
281 | __field(u32, lock); | ||
282 | __field(u32, id); | ||
283 | ), | ||
284 | |||
285 | TP_fast_assign( | ||
286 | __entry->lock = lock; | ||
287 | __entry->id = id; | ||
288 | ), | ||
289 | |||
290 | TP_printk("lock=%u, id=%d", | ||
291 | __entry->lock, __entry->id) | ||
292 | ); | ||
293 | |||
294 | TRACE_EVENT(nvhost_ioctl_ctrl_syncpt_incr, | ||
295 | TP_PROTO(u32 id), | ||
296 | |||
297 | TP_ARGS(id), | ||
298 | |||
299 | TP_STRUCT__entry( | ||
300 | __field(u32, id); | ||
301 | ), | ||
302 | |||
303 | TP_fast_assign( | ||
304 | __entry->id = id; | ||
305 | ), | ||
306 | |||
307 | TP_printk("id=%d", __entry->id) | ||
308 | ); | ||
309 | |||
310 | TRACE_EVENT(nvhost_ioctl_ctrl_syncpt_read, | ||
311 | TP_PROTO(u32 id, u32 value), | ||
312 | |||
313 | TP_ARGS(id, value), | ||
314 | |||
315 | TP_STRUCT__entry( | ||
316 | __field(u32, id); | ||
317 | __field(u32, value); | ||
318 | ), | ||
319 | |||
320 | TP_fast_assign( | ||
321 | __entry->id = id; | ||
322 | __entry->value = value; | ||
323 | ), | ||
324 | |||
325 | TP_printk("id=%d, value=%d", __entry->id, __entry->value) | ||
326 | ); | ||
327 | |||
328 | TRACE_EVENT(nvhost_ioctl_ctrl_syncpt_wait, | ||
329 | TP_PROTO(u32 id, u32 threshold, s32 timeout, u32 value, int err), | ||
330 | |||
331 | TP_ARGS(id, threshold, timeout, value, err), | ||
332 | |||
333 | TP_STRUCT__entry( | ||
334 | __field(u32, id) | ||
335 | __field(u32, threshold) | ||
336 | __field(s32, timeout) | ||
337 | __field(u32, value) | ||
338 | __field(int, err) | ||
339 | ), | ||
340 | |||
341 | TP_fast_assign( | ||
342 | __entry->id = id; | ||
343 | __entry->threshold = threshold; | ||
344 | __entry->timeout = timeout; | ||
345 | __entry->value = value; | ||
346 | __entry->err = err; | ||
347 | ), | ||
348 | |||
349 | TP_printk("id=%u, threshold=%u, timeout=%d, value=%u, err=%d", | ||
350 | __entry->id, __entry->threshold, __entry->timeout, | ||
351 | __entry->value, __entry->err) | ||
352 | ); | ||
353 | |||
354 | TRACE_EVENT(nvhost_ioctl_ctrl_module_regrdwr, | ||
355 | TP_PROTO(u32 id, u32 num_offsets, bool write), | ||
356 | |||
357 | TP_ARGS(id, num_offsets, write), | ||
358 | |||
359 | TP_STRUCT__entry( | ||
360 | __field(u32, id) | ||
361 | __field(u32, num_offsets) | ||
362 | __field(bool, write) | ||
363 | ), | ||
364 | |||
365 | TP_fast_assign( | ||
366 | __entry->id = id; | ||
367 | __entry->num_offsets = num_offsets; | ||
368 | __entry->write = write; | ||
369 | ), | ||
370 | |||
371 | TP_printk("id=%u, num_offsets=%u, write=%d", | ||
372 | __entry->id, __entry->num_offsets, __entry->write) | ||
373 | ); | ||
374 | |||
375 | TRACE_EVENT(nvhost_channel_submitted, | ||
376 | TP_PROTO(const char *name, u32 syncpt_base, u32 syncpt_max), | ||
377 | |||
378 | TP_ARGS(name, syncpt_base, syncpt_max), | ||
379 | |||
380 | TP_STRUCT__entry( | ||
381 | __field(const char *, name) | ||
382 | __field(u32, syncpt_base) | ||
383 | __field(u32, syncpt_max) | ||
384 | ), | ||
385 | |||
386 | TP_fast_assign( | ||
387 | __entry->name = name; | ||
388 | __entry->syncpt_base = syncpt_base; | ||
389 | __entry->syncpt_max = syncpt_max; | ||
390 | ), | ||
391 | |||
392 | TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d", | ||
393 | __entry->name, __entry->syncpt_base, __entry->syncpt_max) | ||
394 | ); | ||
395 | |||
396 | TRACE_EVENT(nvhost_channel_submit_complete, | ||
397 | TP_PROTO(const char *name, int count, u32 thresh), | ||
398 | |||
399 | TP_ARGS(name, count, thresh), | ||
400 | |||
401 | TP_STRUCT__entry( | ||
402 | __field(const char *, name) | ||
403 | __field(int, count) | ||
404 | __field(u32, thresh) | ||
405 | ), | ||
406 | |||
407 | TP_fast_assign( | ||
408 | __entry->name = name; | ||
409 | __entry->count = count; | ||
410 | __entry->thresh = thresh; | ||
411 | ), | ||
412 | |||
413 | TP_printk("name=%s, count=%d, thresh=%d", | ||
414 | __entry->name, __entry->count, __entry->thresh) | ||
415 | ); | ||
416 | |||
417 | TRACE_EVENT(nvhost_wait_cdma, | ||
418 | TP_PROTO(const char *name, u32 eventid), | ||
419 | |||
420 | TP_ARGS(name, eventid), | ||
421 | |||
422 | TP_STRUCT__entry( | ||
423 | __field(const char *, name) | ||
424 | __field(u32, eventid) | ||
425 | ), | ||
426 | |||
427 | TP_fast_assign( | ||
428 | __entry->name = name; | ||
429 | __entry->eventid = eventid; | ||
430 | ), | ||
431 | |||
432 | TP_printk("name=%s, event=%d", __entry->name, __entry->eventid) | ||
433 | ); | ||
434 | |||
435 | #endif /* _TRACE_NVHOST_H */ | ||
436 | |||
437 | /* This part must be outside protection */ | ||
438 | #include <trace/define_trace.h> | ||