]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blob - include/trace/events/nvavp.h
media: tegra: nvavp: Add tracing support for nvavp
[sojka/nv-tegra/linux-3.10.git] / include / trace / events / nvavp.h
1 /*
2  * NVAVP event logging to ftrace.
3  *
4  * Copyright (c) 2014, NVIDIA Corporation.  All rights reserved.
5  *
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.
10  *
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
14  * more details.
15  *
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.
19  */
20
21 #undef TRACE_SYSTEM
22 #define TRACE_SYSTEM nvavp
23
24 #if !defined(_TRACE_NVAVP_H) || defined(TRACE_HEADER_MULTI_READ)
25 #define _TRACE_NVAVP_H
26
27 #include <linux/ktime.h>
28 #include <linux/tracepoint.h>
29
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),
34         TP_STRUCT__entry(
35                 __field(u32, channel_id)
36                 __field(u32, refcount)
37                 __field(u32, video_refcount)
38                 __field(u32, audio_refcount)
39         ),
40         TP_fast_assign(
41                 __entry->channel_id = channel_id;
42                 __entry->refcount = refcount;
43                 __entry->video_refcount = video_refcount;
44                 __entry->audio_refcount = audio_refcount;
45         ),
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)
49 );
50
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)
55 );
56
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)
61 );
62
63 TRACE_EVENT(nvavp_clock_disable_handler,
64         TP_PROTO(u32 put_ptr, u32 get_ptr, u32 nvavp_pending),
65
66         TP_ARGS(put_ptr, get_ptr, nvavp_pending),
67
68         TP_STRUCT__entry(
69                 __field(u32, put_ptr)
70                 __field(u32, get_ptr)
71                 __field(u32, nvavp_pending)
72         ),
73
74         TP_fast_assign(
75                 __entry->put_ptr = put_ptr;
76                 __entry->get_ptr = get_ptr;
77                 __entry->nvavp_pending = nvavp_pending;
78         ),
79
80         TP_printk("put_ptr=%u, get_ptr=%u, nvavp_pending=%d",
81                 __entry->put_ptr, __entry->get_ptr, __entry->nvavp_pending)
82 );
83
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),
88
89         TP_ARGS(channel_id, put_ptr, get_ptr, phys_addr,
90                 gather_count, syncpt_len, syncpt),
91
92         TP_STRUCT__entry(
93                 __field(u32, channel_id)
94                 __field(u32, put_ptr)
95                 __field(u32, get_ptr)
96                 __field(phys_addr_t, phys_addr)
97                 __field(u32, gather_count)
98                 __field(u32, syncpt_len)
99                 __field(bool, syncpt)
100                 __dynamic_array(u32, syncpt, syncpt_len)
101         ),
102
103         TP_fast_assign(
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;
111                 if (syncpt)
112                         memcpy(__get_dynamic_array(syncpt), syncpt, syncpt_len);
113         ),
114
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))
121 );
122
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),
126         TP_STRUCT__entry(
127                 __field(u32, channel_id)
128                 __field(s32, fd)
129                 __field(dma_addr_t, addr)
130         ),
131         TP_fast_assign(
132                 __entry->channel_id = channel_id;
133                 __entry->fd = fd;
134                 __entry->addr = addr;
135         ),
136         TP_printk("channel_id=%d, fd=%d, addr=%08llx",
137                 __entry->channel_id, __entry->fd, (u64) __entry->addr)
138 );
139
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)
143 );
144
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)
148 );
149
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),
153         TP_STRUCT__entry(
154                 __field(u32, channel_id)
155                 __field(u32, clk_id)
156                 __field(u32, rate)
157         ),
158         TP_fast_assign(
159                 __entry->channel_id = channel_id;
160                 __entry->clk_id = clk_id;
161                 __entry->rate = rate;
162         ),
163         TP_printk("channel_id=%d, clk_id=%d, rate=%u",
164                 __entry->channel_id, __entry->clk_id, __entry->rate)
165 );
166
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)
170 );
171
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)
175 );
176
177 TRACE_EVENT(nvavp_get_syncpointid_ioctl,
178         TP_PROTO(u32 channel_id, u32 syncpt_id),
179
180         TP_ARGS(channel_id, syncpt_id),
181
182         TP_STRUCT__entry(
183                 __field(u32, channel_id)
184                 __field(u32, syncpt_id)
185         ),
186
187         TP_fast_assign(
188                 __entry->channel_id = channel_id;
189                 __entry->syncpt_id = syncpt_id;
190         ),
191
192         TP_printk("channel_id=%d, syncpt_id=%d",
193                 __entry->channel_id, __entry->syncpt_id)
194 );
195
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),
199
200         TP_ARGS(channel_id, mem, offset, words,
201                 num_relocs, flags),
202
203         TP_STRUCT__entry(
204                 __field(u32, channel_id)
205                 __field(u32, mem)
206                 __field(u32, offset)
207                 __field(u32, words)
208                 __field(u32, num_relocs)
209                 __field(u32, flags)
210         ),
211
212         TP_fast_assign(
213                 __entry->channel_id = channel_id;
214                 __entry->mem = mem;
215                 __entry->offset = offset;
216                 __entry->words = words;
217                 __entry->num_relocs = num_relocs;
218                 __entry->flags = flags;
219         ),
220
221         TP_printk(
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
225         )
226 );
227
228 TRACE_EVENT(nvavp_force_clock_stay_on_ioctl,
229         TP_PROTO(u32 channel_id, u32 clk_state, u32 clk_reqs),
230
231         TP_ARGS(channel_id, clk_state, clk_reqs),
232
233         TP_STRUCT__entry(
234                 __field(u32, channel_id)
235                 __field(u32, clk_state)
236                 __field(u32, clk_reqs)
237         ),
238
239         TP_fast_assign(
240                 __entry->channel_id = channel_id;
241                 __entry->clk_state = clk_state;
242                 __entry->clk_reqs = clk_reqs;
243         ),
244
245         TP_printk("channel_id=%d, clk_state=%d, clk_reqs=%d",
246                 __entry->channel_id, __entry->clk_state, __entry->clk_reqs)
247 );
248
249 DECLARE_EVENT_CLASS(nvavp_audio_clocks,
250         TP_PROTO(u32 channel_id, u32 clk_id),
251         TP_ARGS(channel_id, clk_id),
252         TP_STRUCT__entry(
253                 __field(u32, channel_id)
254                 __field(u32, clk_id)
255         ),
256         TP_fast_assign(
257                 __entry->channel_id = channel_id;
258                 __entry->clk_id = clk_id;
259         ),
260         TP_printk("channel_id=%d, clk_id=%d",
261                 __entry->channel_id, __entry->clk_id)
262 );
263
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)
267 );
268
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)
272 );
273
274 TRACE_EVENT(nvavp_set_min_online_cpus_ioctl,
275         TP_PROTO(u32 channel_id, u32 num_cpus),
276
277         TP_ARGS(channel_id, num_cpus),
278
279         TP_STRUCT__entry(
280                 __field(u32, channel_id)
281                 __field(u32, num_cpus)
282         ),
283
284         TP_fast_assign(
285                 __entry->channel_id = channel_id;
286                 __entry->num_cpus = num_cpus;
287         ),
288
289         TP_printk("channel_id=%d, num_cpus=%d",
290                 __entry->channel_id, __entry->num_cpus)
291 );
292
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),
296         TP_STRUCT__entry(
297                 __field(u32, refcount)
298                 __field(u32, video_refcount)
299                 __field(u32, audio_refcount)
300         ),
301         TP_fast_assign(
302                 __entry->refcount = refcount;
303                 __entry->video_refcount = video_refcount;
304                 __entry->audio_refcount = audio_refcount;
305         ),
306         TP_printk("refcnt=%d, vid_refcnt=%d, aud_refcnt=%d",
307                 __entry->refcount, __entry->video_refcount,
308                 __entry->audio_refcount)
309 );
310
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)
314 );
315
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)
319 );
320
321 #endif /*  _TRACE_NVAVP_H */
322
323 /* This part must be outside protection */
324 #include <trace/define_trace.h>