xref: /openbmc/linux/include/trace/events/vb2.h (revision d6dd645e)
1b0e0e1f8SJunghak Sung #undef TRACE_SYSTEM
2b0e0e1f8SJunghak Sung #define TRACE_SYSTEM vb2
3b0e0e1f8SJunghak Sung 
4b0e0e1f8SJunghak Sung #if !defined(_TRACE_VB2_H) || defined(TRACE_HEADER_MULTI_READ)
5b0e0e1f8SJunghak Sung #define _TRACE_VB2_H
6b0e0e1f8SJunghak Sung 
7b0e0e1f8SJunghak Sung #include <linux/tracepoint.h>
8b0e0e1f8SJunghak Sung #include <media/videobuf2-core.h>
9b0e0e1f8SJunghak Sung 
10b0e0e1f8SJunghak Sung DECLARE_EVENT_CLASS(vb2_event_class,
11b0e0e1f8SJunghak Sung 	TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
12b0e0e1f8SJunghak Sung 	TP_ARGS(q, vb),
13b0e0e1f8SJunghak Sung 
14b0e0e1f8SJunghak Sung 	TP_STRUCT__entry(
15b0e0e1f8SJunghak Sung 		__field(void *, owner)
16b0e0e1f8SJunghak Sung 		__field(u32, queued_count)
17b0e0e1f8SJunghak Sung 		__field(int, owned_by_drv_count)
18b0e0e1f8SJunghak Sung 		__field(u32, index)
19b0e0e1f8SJunghak Sung 		__field(u32, type)
20b0e0e1f8SJunghak Sung 		__field(u32, bytesused)
21d6dd645eSJunghak Sung 		__field(u64, timestamp)
22b0e0e1f8SJunghak Sung 	),
23b0e0e1f8SJunghak Sung 
24b0e0e1f8SJunghak Sung 	TP_fast_assign(
25b0e0e1f8SJunghak Sung 		__entry->owner = q->owner;
26b0e0e1f8SJunghak Sung 		__entry->queued_count = q->queued_count;
27b0e0e1f8SJunghak Sung 		__entry->owned_by_drv_count =
28b0e0e1f8SJunghak Sung 			atomic_read(&q->owned_by_drv_count);
29b0e0e1f8SJunghak Sung 		__entry->index = vb->index;
30b0e0e1f8SJunghak Sung 		__entry->type = vb->type;
31b0e0e1f8SJunghak Sung 		__entry->bytesused = vb->planes[0].bytesused;
32d6dd645eSJunghak Sung 		__entry->timestamp = vb->timestamp;
33b0e0e1f8SJunghak Sung 	),
34b0e0e1f8SJunghak Sung 
35b0e0e1f8SJunghak Sung 	TP_printk("owner = %p, queued = %u, owned_by_drv = %d, index = %u, "
36d6dd645eSJunghak Sung 		  "type = %u, bytesused = %u, timestamp = %llu", __entry->owner,
37b0e0e1f8SJunghak Sung 		  __entry->queued_count,
38b0e0e1f8SJunghak Sung 		  __entry->owned_by_drv_count,
39b0e0e1f8SJunghak Sung 		  __entry->index, __entry->type,
40d6dd645eSJunghak Sung 		  __entry->bytesused,
41d6dd645eSJunghak Sung 		  __entry->timestamp
42b0e0e1f8SJunghak Sung 	)
43b0e0e1f8SJunghak Sung )
44b0e0e1f8SJunghak Sung 
45b0e0e1f8SJunghak Sung DEFINE_EVENT(vb2_event_class, vb2_buf_done,
46b0e0e1f8SJunghak Sung 	TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
47b0e0e1f8SJunghak Sung 	TP_ARGS(q, vb)
48b0e0e1f8SJunghak Sung );
49b0e0e1f8SJunghak Sung 
50b0e0e1f8SJunghak Sung DEFINE_EVENT(vb2_event_class, vb2_buf_queue,
51b0e0e1f8SJunghak Sung 	TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
52b0e0e1f8SJunghak Sung 	TP_ARGS(q, vb)
53b0e0e1f8SJunghak Sung );
54b0e0e1f8SJunghak Sung 
55b0e0e1f8SJunghak Sung DEFINE_EVENT(vb2_event_class, vb2_dqbuf,
56b0e0e1f8SJunghak Sung 	TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
57b0e0e1f8SJunghak Sung 	TP_ARGS(q, vb)
58b0e0e1f8SJunghak Sung );
59b0e0e1f8SJunghak Sung 
60b0e0e1f8SJunghak Sung DEFINE_EVENT(vb2_event_class, vb2_qbuf,
61b0e0e1f8SJunghak Sung 	TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
62b0e0e1f8SJunghak Sung 	TP_ARGS(q, vb)
63b0e0e1f8SJunghak Sung );
64b0e0e1f8SJunghak Sung 
65b0e0e1f8SJunghak Sung #endif /* if !defined(_TRACE_VB2_H) || defined(TRACE_HEADER_MULTI_READ) */
66b0e0e1f8SJunghak Sung 
67b0e0e1f8SJunghak Sung /* This part must be outside protection */
68b0e0e1f8SJunghak Sung #include <trace/define_trace.h>
69