blob: c1a22416ed0551b36f0467d320d511c8eb95dbf5 [file] [log] [blame]
Junghak Sungb0e0e1f2015-10-06 06:37:48 -03001#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)
Junghak Sungd6dd6452015-11-03 08:16:37 -020021 __field(u64, timestamp)
Junghak Sungb0e0e1f2015-10-06 06:37:48 -030022 ),
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;
Junghak Sungd6dd6452015-11-03 08:16:37 -020032 __entry->timestamp = vb->timestamp;
Junghak Sungb0e0e1f2015-10-06 06:37:48 -030033 ),
34
35 TP_printk("owner = %p, queued = %u, owned_by_drv = %d, index = %u, "
Junghak Sungd6dd6452015-11-03 08:16:37 -020036 "type = %u, bytesused = %u, timestamp = %llu", __entry->owner,
Junghak Sungb0e0e1f2015-10-06 06:37:48 -030037 __entry->queued_count,
38 __entry->owned_by_drv_count,
39 __entry->index, __entry->type,
Junghak Sungd6dd6452015-11-03 08:16:37 -020040 __entry->bytesused,
41 __entry->timestamp
Junghak Sungb0e0e1f2015-10-06 06:37:48 -030042 )
43)
44
45DEFINE_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
50DEFINE_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
55DEFINE_EVENT(vb2_event_class, vb2_dqbuf,
56 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
57 TP_ARGS(q, vb)
58);
59
60DEFINE_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>