2 * include/trace/events/host1x.h
4 * host1x event logging to ftrace.
6 * Copyright (c) 2010-2013, NVIDIA Corporation.
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.
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
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.
24 #define TRACE_SYSTEM host1x
26 #if !defined(_TRACE_HOST1X_H) || defined(TRACE_HEADER_MULTI_READ)
27 #define _TRACE_HOST1X_H
29 #include <linux/ktime.h>
30 #include <linux/tracepoint.h>
32 DECLARE_EVENT_CLASS(host1x,
33 TP_PROTO(const char *name),
35 TP_STRUCT__entry(__field(const char *, name)),
36 TP_fast_assign(__entry->name = name;),
37 TP_printk("name=%s", __entry->name)
40 DEFINE_EVENT(host1x, host1x_channel_open,
41 TP_PROTO(const char *name),
45 DEFINE_EVENT(host1x, host1x_channel_release,
46 TP_PROTO(const char *name),
50 DEFINE_EVENT(host1x, host1x_cdma_begin,
51 TP_PROTO(const char *name),
55 DEFINE_EVENT(host1x, host1x_cdma_end,
56 TP_PROTO(const char *name),
60 TRACE_EVENT(host1x_cdma_push,
61 TP_PROTO(const char *name, u32 op1, u32 op2),
63 TP_ARGS(name, op1, op2),
66 __field(const char *, name)
77 TP_printk("name=%s, op1=%08x, op2=%08x",
78 __entry->name, __entry->op1, __entry->op2)
81 TRACE_EVENT(host1x_cdma_push_gather,
82 TP_PROTO(const char *name, u32 mem_id,
83 u32 words, u32 offset, void *cmdbuf),
85 TP_ARGS(name, mem_id, words, offset, cmdbuf),
88 __field(const char *, name)
93 __dynamic_array(u32, cmdbuf, words)
98 memcpy(__get_dynamic_array(cmdbuf), cmdbuf+offset,
101 __entry->cmdbuf = cmdbuf;
102 __entry->name = name;
103 __entry->mem_id = mem_id;
104 __entry->words = words;
105 __entry->offset = offset;
108 TP_printk("name=%s, mem_id=%08x, words=%u, offset=%d, contents=[%s]",
109 __entry->name, __entry->mem_id,
110 __entry->words, __entry->offset,
111 __print_hex(__get_dynamic_array(cmdbuf),
112 __entry->cmdbuf ? __entry->words * 4 : 0))
115 TRACE_EVENT(host1x_channel_submit,
116 TP_PROTO(const char *name, u32 cmdbufs, u32 relocs, u32 waitchks,
117 u32 syncpt_id, u32 syncpt_incrs),
119 TP_ARGS(name, cmdbufs, relocs, waitchks, syncpt_id, syncpt_incrs),
122 __field(const char *, name)
123 __field(u32, cmdbufs)
125 __field(u32, waitchks)
126 __field(u32, syncpt_id)
127 __field(u32, syncpt_incrs)
131 __entry->name = name;
132 __entry->cmdbufs = cmdbufs;
133 __entry->relocs = relocs;
134 __entry->waitchks = waitchks;
135 __entry->syncpt_id = syncpt_id;
136 __entry->syncpt_incrs = syncpt_incrs;
139 TP_printk("name=%s, cmdbufs=%u, relocs=%u, waitchks=%d,"
140 "syncpt_id=%u, syncpt_incrs=%u",
141 __entry->name, __entry->cmdbufs, __entry->relocs, __entry->waitchks,
142 __entry->syncpt_id, __entry->syncpt_incrs)
145 TRACE_EVENT(host1x_channel_submitted,
146 TP_PROTO(const char *name, u32 syncpt_base, u32 syncpt_max),
148 TP_ARGS(name, syncpt_base, syncpt_max),
151 __field(const char *, name)
152 __field(u32, syncpt_base)
153 __field(u32, syncpt_max)
157 __entry->name = name;
158 __entry->syncpt_base = syncpt_base;
159 __entry->syncpt_max = syncpt_max;
162 TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d",
163 __entry->name, __entry->syncpt_base, __entry->syncpt_max)
166 TRACE_EVENT(host1x_channel_submit_complete,
167 TP_PROTO(const char *name, int count, u32 thresh),
169 TP_ARGS(name, count, thresh),
172 __field(const char *, name)
178 __entry->name = name;
179 __entry->count = count;
180 __entry->thresh = thresh;
183 TP_printk("name=%s, count=%d, thresh=%d",
184 __entry->name, __entry->count, __entry->thresh)
187 TRACE_EVENT(host1x_wait_cdma,
188 TP_PROTO(const char *name, u32 eventid),
190 TP_ARGS(name, eventid),
193 __field(const char *, name)
194 __field(u32, eventid)
198 __entry->name = name;
199 __entry->eventid = eventid;
202 TP_printk("name=%s, event=%d", __entry->name, __entry->eventid)
205 TRACE_EVENT(host1x_syncpt_load_min,
206 TP_PROTO(u32 id, u32 val),
220 TP_printk("id=%d, val=%d", __entry->id, __entry->val)
223 TRACE_EVENT(host1x_syncpt_wait_check,
224 TP_PROTO(void *mem_id, u32 offset, u32 syncpt_id, u32 thresh, u32 min),
226 TP_ARGS(mem_id, offset, syncpt_id, thresh, min),
229 __field(void *, mem_id)
231 __field(u32, syncpt_id)
237 __entry->mem_id = mem_id;
238 __entry->offset = offset;
239 __entry->syncpt_id = syncpt_id;
240 __entry->thresh = thresh;
244 TP_printk("mem_id=%p, offset=%05x, id=%d, thresh=%d, current=%d",
245 __entry->mem_id, __entry->offset,
246 __entry->syncpt_id, __entry->thresh,
250 #endif /* _TRACE_HOST1X_H */
252 /* This part must be outside protection */
253 #include <trace/define_trace.h>