1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * include/trace/events/host1x.h
5 * host1x event logging to ftrace.
7 * Copyright (c) 2010-2013, NVIDIA Corporation.
11 #define TRACE_SYSTEM host1x
13 #if !defined(_TRACE_HOST1X_H) || defined(TRACE_HEADER_MULTI_READ)
14 #define _TRACE_HOST1X_H
16 #include <linux/ktime.h>
17 #include <linux/tracepoint.h>
21 DECLARE_EVENT_CLASS(host1x
,
22 TP_PROTO(const char *name
),
24 TP_STRUCT__entry(__field(const char *, name
)),
25 TP_fast_assign(__entry
->name
= name
;),
26 TP_printk("name=%s", __entry
->name
)
29 DEFINE_EVENT(host1x
, host1x_channel_open
,
30 TP_PROTO(const char *name
),
34 DEFINE_EVENT(host1x
, host1x_channel_release
,
35 TP_PROTO(const char *name
),
39 DEFINE_EVENT(host1x
, host1x_cdma_begin
,
40 TP_PROTO(const char *name
),
44 DEFINE_EVENT(host1x
, host1x_cdma_end
,
45 TP_PROTO(const char *name
),
49 TRACE_EVENT(host1x_cdma_push
,
50 TP_PROTO(const char *name
, u32 op1
, u32 op2
),
52 TP_ARGS(name
, op1
, op2
),
55 __field(const char *, name
)
66 TP_printk("name=%s, op1=%08x, op2=%08x",
67 __entry
->name
, __entry
->op1
, __entry
->op2
)
70 TRACE_EVENT(host1x_cdma_push_wide
,
71 TP_PROTO(const char *name
, u32 op1
, u32 op2
, u32 op3
, u32 op4
),
73 TP_ARGS(name
, op1
, op2
, op3
, op4
),
76 __field(const char *, name
)
91 TP_printk("name=%s, op1=%08x, op2=%08x, op3=%08x op4=%08x",
92 __entry
->name
, __entry
->op1
, __entry
->op2
, __entry
->op3
,
96 TRACE_EVENT(host1x_cdma_push_gather
,
97 TP_PROTO(const char *name
, struct host1x_bo
*bo
,
98 u32 words
, u32 offset
, void *cmdbuf
),
100 TP_ARGS(name
, bo
, words
, offset
, cmdbuf
),
103 __field(const char *, name
)
104 __field(struct host1x_bo
*, bo
)
107 __field(bool, cmdbuf
)
108 __dynamic_array(u32
, cmdbuf
, words
)
113 memcpy(__get_dynamic_array(cmdbuf
), cmdbuf
+offset
,
114 words
* sizeof(u32
));
116 __entry
->cmdbuf
= cmdbuf
;
117 __entry
->name
= name
;
119 __entry
->words
= words
;
120 __entry
->offset
= offset
;
123 TP_printk("name=%s, bo=%p, words=%u, offset=%d, contents=[%s]",
124 __entry
->name
, __entry
->bo
,
125 __entry
->words
, __entry
->offset
,
126 __print_hex(__get_dynamic_array(cmdbuf
),
127 __entry
->cmdbuf
? __entry
->words
* 4 : 0))
130 TRACE_EVENT(host1x_channel_submit
,
131 TP_PROTO(const char *name
, u32 cmdbufs
, u32 relocs
, u32 syncpt_id
,
134 TP_ARGS(name
, cmdbufs
, relocs
, syncpt_id
, syncpt_incrs
),
137 __field(const char *, name
)
138 __field(u32
, cmdbufs
)
140 __field(u32
, syncpt_id
)
141 __field(u32
, syncpt_incrs
)
145 __entry
->name
= name
;
146 __entry
->cmdbufs
= cmdbufs
;
147 __entry
->relocs
= relocs
;
148 __entry
->syncpt_id
= syncpt_id
;
149 __entry
->syncpt_incrs
= syncpt_incrs
;
152 TP_printk("name=%s, cmdbufs=%u, relocs=%u, syncpt_id=%u, "
154 __entry
->name
, __entry
->cmdbufs
, __entry
->relocs
,
155 __entry
->syncpt_id
, __entry
->syncpt_incrs
)
158 TRACE_EVENT(host1x_channel_submitted
,
159 TP_PROTO(const char *name
, u32 syncpt_base
, u32 syncpt_max
),
161 TP_ARGS(name
, syncpt_base
, syncpt_max
),
164 __field(const char *, name
)
165 __field(u32
, syncpt_base
)
166 __field(u32
, syncpt_max
)
170 __entry
->name
= name
;
171 __entry
->syncpt_base
= syncpt_base
;
172 __entry
->syncpt_max
= syncpt_max
;
175 TP_printk("name=%s, syncpt_base=%d, syncpt_max=%d",
176 __entry
->name
, __entry
->syncpt_base
, __entry
->syncpt_max
)
179 TRACE_EVENT(host1x_channel_submit_complete
,
180 TP_PROTO(const char *name
, int count
, u32 thresh
),
182 TP_ARGS(name
, count
, thresh
),
185 __field(const char *, name
)
191 __entry
->name
= name
;
192 __entry
->count
= count
;
193 __entry
->thresh
= thresh
;
196 TP_printk("name=%s, count=%d, thresh=%d",
197 __entry
->name
, __entry
->count
, __entry
->thresh
)
200 TRACE_EVENT(host1x_wait_cdma
,
201 TP_PROTO(const char *name
, u32 eventid
),
203 TP_ARGS(name
, eventid
),
206 __field(const char *, name
)
207 __field(u32
, eventid
)
211 __entry
->name
= name
;
212 __entry
->eventid
= eventid
;
215 TP_printk("name=%s, event=%d", __entry
->name
, __entry
->eventid
)
218 TRACE_EVENT(host1x_syncpt_load_min
,
219 TP_PROTO(u32 id
, u32 val
),
233 TP_printk("id=%d, val=%d", __entry
->id
, __entry
->val
)
236 TRACE_EVENT(host1x_syncpt_wait_check
,
237 TP_PROTO(struct host1x_bo
*bo
, u32 offset
, u32 syncpt_id
, u32 thresh
,
240 TP_ARGS(bo
, offset
, syncpt_id
, thresh
, min
),
243 __field(struct host1x_bo
*, bo
)
245 __field(u32
, syncpt_id
)
252 __entry
->offset
= offset
;
253 __entry
->syncpt_id
= syncpt_id
;
254 __entry
->thresh
= thresh
;
258 TP_printk("bo=%p, offset=%05x, id=%d, thresh=%d, current=%d",
259 __entry
->bo
, __entry
->offset
,
260 __entry
->syncpt_id
, __entry
->thresh
,
264 #endif /* _TRACE_HOST1X_H */
266 /* This part must be outside protection */
267 #include <trace/define_trace.h>