aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorJunghak Sung <jh1009.sung@samsung.com>2015-10-06 05:37:48 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-10-20 13:12:45 -0400
commitb0e0e1f83de31aa0428c38b692c590cc0ecd3f03 (patch)
tree21f1018973380de7d7883e338944a6aa1c8521a0 /include/trace
parentbed04f9342473743fc96b71c3130f645c718bd47 (diff)
[media] media: videobuf2: Prepare to divide videobuf2
Prepare to divide videobuf2 - Separate vb2 trace events from v4l2 trace event. - Make wrapper functions that will move to v4l2-side. - Make vb2_core_* functions that will remain in core-side. - Add a callback function table for buffer operation which makes vb2-core to be able to invoke a v4l2-side functions. - Rename internal functions as vb2_*. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'include/trace')
-rw-r--r--include/trace/events/v4l2.h28
-rw-r--r--include/trace/events/vb2.h65
2 files changed, 71 insertions, 22 deletions
diff --git a/include/trace/events/v4l2.h b/include/trace/events/v4l2.h
index 375b1a3138c2..04ef89b15ae2 100644
--- a/include/trace/events/v4l2.h
+++ b/include/trace/events/v4l2.h
@@ -175,17 +175,12 @@ DEFINE_EVENT(v4l2_event_class, v4l2_qbuf,
175 TP_ARGS(minor, buf) 175 TP_ARGS(minor, buf)
176); 176);
177 177
178DECLARE_EVENT_CLASS(vb2_event_class, 178DECLARE_EVENT_CLASS(vb2_v4l2_event_class,
179 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb), 179 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
180 TP_ARGS(q, vb), 180 TP_ARGS(q, vb),
181 181
182 TP_STRUCT__entry( 182 TP_STRUCT__entry(
183 __field(int, minor) 183 __field(int, minor)
184 __field(u32, queued_count)
185 __field(int, owned_by_drv_count)
186 __field(u32, index)
187 __field(u32, type)
188 __field(u32, bytesused)
189 __field(u32, flags) 184 __field(u32, flags)
190 __field(u32, field) 185 __field(u32, field)
191 __field(s64, timestamp) 186 __field(s64, timestamp)
@@ -207,12 +202,6 @@ DECLARE_EVENT_CLASS(vb2_event_class,
207 struct v4l2_fh *owner = q->owner; 202 struct v4l2_fh *owner = q->owner;
208 203
209 __entry->minor = owner ? owner->vdev->minor : -1; 204 __entry->minor = owner ? owner->vdev->minor : -1;
210 __entry->queued_count = q->queued_count;
211 __entry->owned_by_drv_count =
212 atomic_read(&q->owned_by_drv_count);
213 __entry->index = vb->index;
214 __entry->type = vb->type;
215 __entry->bytesused = vb->planes[0].bytesused;
216 __entry->flags = vbuf->flags; 205 __entry->flags = vbuf->flags;
217 __entry->field = vbuf->field; 206 __entry->field = vbuf->field;
218 __entry->timestamp = timeval_to_ns(&vbuf->timestamp); 207 __entry->timestamp = timeval_to_ns(&vbuf->timestamp);
@@ -229,15 +218,10 @@ DECLARE_EVENT_CLASS(vb2_event_class,
229 __entry->sequence = vbuf->sequence; 218 __entry->sequence = vbuf->sequence;
230 ), 219 ),
231 220
232 TP_printk("minor = %d, queued = %u, owned_by_drv = %d, index = %u, " 221 TP_printk("minor=%d flags = %s, field = %s, "
233 "type = %s, bytesused = %u, flags = %s, field = %s, "
234 "timestamp = %llu, timecode = { type = %s, flags = %s, " 222 "timestamp = %llu, timecode = { type = %s, flags = %s, "
235 "frames = %u, seconds = %u, minutes = %u, hours = %u, " 223 "frames = %u, seconds = %u, minutes = %u, hours = %u, "
236 "userbits = { %u %u %u %u } }, sequence = %u", __entry->minor, 224 "userbits = { %u %u %u %u } }, sequence = %u", __entry->minor,
237 __entry->queued_count,
238 __entry->owned_by_drv_count,
239 __entry->index, show_type(__entry->type),
240 __entry->bytesused,
241 show_flags(__entry->flags), 225 show_flags(__entry->flags),
242 show_field(__entry->field), 226 show_field(__entry->field),
243 __entry->timestamp, 227 __entry->timestamp,
@@ -255,22 +239,22 @@ DECLARE_EVENT_CLASS(vb2_event_class,
255 ) 239 )
256) 240)
257 241
258DEFINE_EVENT(vb2_event_class, vb2_buf_done, 242DEFINE_EVENT(vb2_v4l2_event_class, vb2_v4l2_buf_done,
259 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb), 243 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
260 TP_ARGS(q, vb) 244 TP_ARGS(q, vb)
261); 245);
262 246
263DEFINE_EVENT(vb2_event_class, vb2_buf_queue, 247DEFINE_EVENT(vb2_v4l2_event_class, vb2_v4l2_buf_queue,
264 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb), 248 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
265 TP_ARGS(q, vb) 249 TP_ARGS(q, vb)
266); 250);
267 251
268DEFINE_EVENT(vb2_event_class, vb2_dqbuf, 252DEFINE_EVENT(vb2_v4l2_event_class, vb2_v4l2_dqbuf,
269 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb), 253 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
270 TP_ARGS(q, vb) 254 TP_ARGS(q, vb)
271); 255);
272 256
273DEFINE_EVENT(vb2_event_class, vb2_qbuf, 257DEFINE_EVENT(vb2_v4l2_event_class, vb2_v4l2_qbuf,
274 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb), 258 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
275 TP_ARGS(q, vb) 259 TP_ARGS(q, vb)
276); 260);
diff --git a/include/trace/events/vb2.h b/include/trace/events/vb2.h
new file mode 100644
index 000000000000..bfeceeba3744
--- /dev/null
+++ b/include/trace/events/vb2.h
@@ -0,0 +1,65 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM vb2
3
4#if !defined(_TRACE_VB2_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_VB2_H
6
7#include <linux/tracepoint.h>
8#include <media/videobuf2-core.h>
9
10DECLARE_EVENT_CLASS(vb2_event_class,
11 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
12 TP_ARGS(q, vb),
13
14 TP_STRUCT__entry(
15 __field(void *, owner)
16 __field(u32, queued_count)
17 __field(int, owned_by_drv_count)
18 __field(u32, index)
19 __field(u32, type)
20 __field(u32, bytesused)
21 ),
22
23 TP_fast_assign(
24 __entry->owner = q->owner;
25 __entry->queued_count = q->queued_count;
26 __entry->owned_by_drv_count =
27 atomic_read(&q->owned_by_drv_count);
28 __entry->index = vb->index;
29 __entry->type = vb->type;
30 __entry->bytesused = vb->planes[0].bytesused;
31 ),
32
33 TP_printk("owner = %p, queued = %u, owned_by_drv = %d, index = %u, "
34 "type = %u, bytesused = %u", __entry->owner,
35 __entry->queued_count,
36 __entry->owned_by_drv_count,
37 __entry->index, __entry->type,
38 __entry->bytesused
39 )
40)
41
42DEFINE_EVENT(vb2_event_class, vb2_buf_done,
43 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
44 TP_ARGS(q, vb)
45);
46
47DEFINE_EVENT(vb2_event_class, vb2_buf_queue,
48 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
49 TP_ARGS(q, vb)
50);
51
52DEFINE_EVENT(vb2_event_class, vb2_dqbuf,
53 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
54 TP_ARGS(q, vb)
55);
56
57DEFINE_EVENT(vb2_event_class, vb2_qbuf,
58 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
59 TP_ARGS(q, vb)
60);
61
62#endif /* if !defined(_TRACE_VB2_H) || defined(TRACE_HEADER_MULTI_READ) */
63
64/* This part must be outside protection */
65#include <trace/define_trace.h>