xref: /linux/include/trace/events/vb2.h (revision b6ebbac51bedf9e98e837688bc838f400196da5e)
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 
10 DECLARE_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 		__field(u64, timestamp)
22 	),
23 
24 	TP_fast_assign(
25 		__entry->owner = q->owner;
26 		__entry->queued_count = q->queued_count;
27 		__entry->owned_by_drv_count =
28 			atomic_read(&q->owned_by_drv_count);
29 		__entry->index = vb->index;
30 		__entry->type = vb->type;
31 		__entry->bytesused = vb->planes[0].bytesused;
32 		__entry->timestamp = vb->timestamp;
33 	),
34 
35 	TP_printk("owner = %p, queued = %u, owned_by_drv = %d, index = %u, "
36 		  "type = %u, bytesused = %u, timestamp = %llu", __entry->owner,
37 		  __entry->queued_count,
38 		  __entry->owned_by_drv_count,
39 		  __entry->index, __entry->type,
40 		  __entry->bytesused,
41 		  __entry->timestamp
42 	)
43 )
44 
45 DEFINE_EVENT(vb2_event_class, vb2_buf_done,
46 	TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
47 	TP_ARGS(q, vb)
48 );
49 
50 DEFINE_EVENT(vb2_event_class, vb2_buf_queue,
51 	TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
52 	TP_ARGS(q, vb)
53 );
54 
55 DEFINE_EVENT(vb2_event_class, vb2_dqbuf,
56 	TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
57 	TP_ARGS(q, vb)
58 );
59 
60 DEFINE_EVENT(vb2_event_class, vb2_qbuf,
61 	TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
62 	TP_ARGS(q, vb)
63 );
64 
65 #endif /* if !defined(_TRACE_VB2_H) || defined(TRACE_HEADER_MULTI_READ) */
66 
67 /* This part must be outside protection */
68 #include <trace/define_trace.h>
69