2 * NVAVP event logging to ftrace.
4 * Copyright (c) 2014, NVIDIA Corporation. All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 #define TRACE_SYSTEM nvavp
24 #if !defined(_TRACE_NVAVP_H) || defined(TRACE_HEADER_MULTI_READ)
25 #define _TRACE_NVAVP_H
27 #include <linux/ktime.h>
28 #include <linux/tracepoint.h>
30 DECLARE_EVENT_CLASS(nvavp,
31 TP_PROTO(u32 channel_id, u32 refcount,
32 u32 video_refcount, u32 audio_refcount),
33 TP_ARGS(channel_id, refcount, video_refcount, audio_refcount),
35 __field(u32, channel_id)
36 __field(u32, refcount)
37 __field(u32, video_refcount)
38 __field(u32, audio_refcount)
41 __entry->channel_id = channel_id;
42 __entry->refcount = refcount;
43 __entry->video_refcount = video_refcount;
44 __entry->audio_refcount = audio_refcount;
46 TP_printk("channel_id=%d, refcnt=%d, vid_refcnt=%d, aud_refcnt=%d",
47 __entry->channel_id, __entry->refcount, __entry->video_refcount,
48 __entry->audio_refcount)
51 DEFINE_EVENT(nvavp, tegra_nvavp_open,
52 TP_PROTO(u32 channel_id, u32 refcount,
53 u32 video_refcount, u32 audio_refcount),
54 TP_ARGS(channel_id, refcount, video_refcount, audio_refcount)
57 DEFINE_EVENT(nvavp, tegra_nvavp_release,
58 TP_PROTO(u32 channel_id, u32 refcount,
59 u32 video_refcount, u32 audio_refcount),
60 TP_ARGS(channel_id, refcount, video_refcount, audio_refcount)
63 TRACE_EVENT(nvavp_clock_disable_handler,
64 TP_PROTO(u32 put_ptr, u32 get_ptr, u32 nvavp_pending),
66 TP_ARGS(put_ptr, get_ptr, nvavp_pending),
71 __field(u32, nvavp_pending)
75 __entry->put_ptr = put_ptr;
76 __entry->get_ptr = get_ptr;
77 __entry->nvavp_pending = nvavp_pending;
80 TP_printk("put_ptr=%u, get_ptr=%u, nvavp_pending=%d",
81 __entry->put_ptr, __entry->get_ptr, __entry->nvavp_pending)
84 TRACE_EVENT(nvavp_pushbuffer_update,
85 TP_PROTO(u32 channel_id, u32 put_ptr, u32 get_ptr,
86 phys_addr_t phys_addr, u32 gather_count,
87 u32 syncpt_len, void *syncpt),
89 TP_ARGS(channel_id, put_ptr, get_ptr, phys_addr,
90 gather_count, syncpt_len, syncpt),
93 __field(u32, channel_id)
96 __field(phys_addr_t, phys_addr)
97 __field(u32, gather_count)
98 __field(u32, syncpt_len)
100 __dynamic_array(u32, syncpt, syncpt_len)
104 __entry->channel_id = channel_id;
105 __entry->put_ptr = put_ptr;
106 __entry->get_ptr = get_ptr;
107 __entry->phys_addr = phys_addr;
108 __entry->gather_count = gather_count;
109 __entry->syncpt_len = syncpt_len;
110 __entry->syncpt = syncpt;
112 memcpy(__get_dynamic_array(syncpt), syncpt, syncpt_len);
115 TP_printk("channel_id=%d, put_ptr=%d, get_ptr=%d, phys_addr=%08llx, gather_count=%d, syncpt_len=%d, syncpt=%s",
116 __entry->channel_id, __entry->put_ptr,
117 __entry->get_ptr, (u64)__entry->phys_addr,
118 __entry->gather_count, __entry->syncpt_len,
119 __print_hex(__get_dynamic_array(syncpt),
120 __entry->syncpt ? __entry->syncpt_len : 0))
123 DECLARE_EVENT_CLASS(nvavp_iova,
124 TP_PROTO(u32 channel_id, s32 fd, dma_addr_t addr),
125 TP_ARGS(channel_id, fd, addr),
127 __field(u32, channel_id)
129 __field(dma_addr_t, addr)
132 __entry->channel_id = channel_id;
134 __entry->addr = addr;
136 TP_printk("channel_id=%d, fd=%d, addr=%08llx",
137 __entry->channel_id, __entry->fd, (u64) __entry->addr)
140 DEFINE_EVENT(nvavp_iova, nvavp_map_iova,
141 TP_PROTO(u32 channel_id, s32 fd, dma_addr_t addr),
142 TP_ARGS(channel_id, fd, addr)
145 DEFINE_EVENT(nvavp_iova, nvavp_unmap_iova,
146 TP_PROTO(u32 channel_id, s32 fd, dma_addr_t addr),
147 TP_ARGS(channel_id, fd, addr)
150 DECLARE_EVENT_CLASS(nvavp_clock,
151 TP_PROTO(u32 channel_id, u32 clk_id, u32 rate),
152 TP_ARGS(channel_id, clk_id, rate),
154 __field(u32, channel_id)
159 __entry->channel_id = channel_id;
160 __entry->clk_id = clk_id;
161 __entry->rate = rate;
163 TP_printk("channel_id=%d, clk_id=%d, rate=%u",
164 __entry->channel_id, __entry->clk_id, __entry->rate)
167 DEFINE_EVENT(nvavp_clock, nvavp_set_clock_ioctl,
168 TP_PROTO(u32 channel_id, u32 clk_id, u32 rate),
169 TP_ARGS(channel_id, clk_id, rate)
172 DEFINE_EVENT(nvavp_clock, nvavp_get_clock_ioctl,
173 TP_PROTO(u32 channel_id, u32 clk_id, u32 rate),
174 TP_ARGS(channel_id, clk_id, rate)
177 TRACE_EVENT(nvavp_get_syncpointid_ioctl,
178 TP_PROTO(u32 channel_id, u32 syncpt_id),
180 TP_ARGS(channel_id, syncpt_id),
183 __field(u32, channel_id)
184 __field(u32, syncpt_id)
188 __entry->channel_id = channel_id;
189 __entry->syncpt_id = syncpt_id;
192 TP_printk("channel_id=%d, syncpt_id=%d",
193 __entry->channel_id, __entry->syncpt_id)
196 TRACE_EVENT(nvavp_pushbuffer_submit_ioctl,
197 TP_PROTO(u32 channel_id, u32 mem, u32 offset, u32 words,
198 u32 num_relocs, u32 flags),
200 TP_ARGS(channel_id, mem, offset, words,
204 __field(u32, channel_id)
208 __field(u32, num_relocs)
213 __entry->channel_id = channel_id;
215 __entry->offset = offset;
216 __entry->words = words;
217 __entry->num_relocs = num_relocs;
218 __entry->flags = flags;
222 "channel_id=%d, mem=%u, offset=%d, words=%d, num_relocs = %d, flags=%d",
223 __entry->channel_id, __entry->mem, __entry->offset,
224 __entry->words, __entry->num_relocs, __entry->flags
228 TRACE_EVENT(nvavp_force_clock_stay_on_ioctl,
229 TP_PROTO(u32 channel_id, u32 clk_state, u32 clk_reqs),
231 TP_ARGS(channel_id, clk_state, clk_reqs),
234 __field(u32, channel_id)
235 __field(u32, clk_state)
236 __field(u32, clk_reqs)
240 __entry->channel_id = channel_id;
241 __entry->clk_state = clk_state;
242 __entry->clk_reqs = clk_reqs;
245 TP_printk("channel_id=%d, clk_state=%d, clk_reqs=%d",
246 __entry->channel_id, __entry->clk_state, __entry->clk_reqs)
249 DECLARE_EVENT_CLASS(nvavp_audio_clocks,
250 TP_PROTO(u32 channel_id, u32 clk_id),
251 TP_ARGS(channel_id, clk_id),
253 __field(u32, channel_id)
257 __entry->channel_id = channel_id;
258 __entry->clk_id = clk_id;
260 TP_printk("channel_id=%d, clk_id=%d",
261 __entry->channel_id, __entry->clk_id)
264 DEFINE_EVENT(nvavp_audio_clocks, nvavp_enable_audio_clocks,
265 TP_PROTO(u32 channel_id, u32 clk_id),
266 TP_ARGS(channel_id, clk_id)
269 DEFINE_EVENT(nvavp_audio_clocks, nvavp_disable_audio_clocks,
270 TP_PROTO(u32 channel_id, u32 clk_id),
271 TP_ARGS(channel_id, clk_id)
274 TRACE_EVENT(nvavp_set_min_online_cpus_ioctl,
275 TP_PROTO(u32 channel_id, u32 num_cpus),
277 TP_ARGS(channel_id, num_cpus),
280 __field(u32, channel_id)
281 __field(u32, num_cpus)
285 __entry->channel_id = channel_id;
286 __entry->num_cpus = num_cpus;
289 TP_printk("channel_id=%d, num_cpus=%d",
290 __entry->channel_id, __entry->num_cpus)
293 DECLARE_EVENT_CLASS(nvavp_suspend_resume,
294 TP_PROTO(u32 refcount, u32 video_refcount, u32 audio_refcount),
295 TP_ARGS(refcount, video_refcount, audio_refcount),
297 __field(u32, refcount)
298 __field(u32, video_refcount)
299 __field(u32, audio_refcount)
302 __entry->refcount = refcount;
303 __entry->video_refcount = video_refcount;
304 __entry->audio_refcount = audio_refcount;
306 TP_printk("refcnt=%d, vid_refcnt=%d, aud_refcnt=%d",
307 __entry->refcount, __entry->video_refcount,
308 __entry->audio_refcount)
311 DEFINE_EVENT(nvavp_suspend_resume, tegra_nvavp_runtime_suspend,
312 TP_PROTO(u32 refcount, u32 video_refcount, u32 audio_refcount),
313 TP_ARGS(refcount, video_refcount, audio_refcount)
316 DEFINE_EVENT(nvavp_suspend_resume, tegra_nvavp_runtime_resume,
317 TP_PROTO(u32 refcount, u32 video_refcount, u32 audio_refcount),
318 TP_ARGS(refcount, video_refcount, audio_refcount)
321 #endif /* _TRACE_NVAVP_H */
323 /* This part must be outside protection */
324 #include <trace/define_trace.h>