aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/media/platform/coda/trace.h
blob: f20666a4aa89b0e4e7626952b8a172df747f0d1a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#undef TRACE_SYSTEM
#define TRACE_SYSTEM coda

#if !defined(__CODA_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
#define __CODA_TRACE_H__

#include <linux/tracepoint.h>
#include <media/videobuf2-v4l2.h>

#include "coda.h"

TRACE_EVENT(coda_bit_run,
	TP_PROTO(struct coda_ctx *ctx, int cmd),

	TP_ARGS(ctx, cmd),

	TP_STRUCT__entry(
		__field(int, minor)
		__field(int, ctx)
		__field(int, cmd)
	),

	TP_fast_assign(
		__entry->minor = ctx->fh.vdev->minor;
		__entry->ctx = ctx->idx;
		__entry->cmd = cmd;
	),

	TP_printk("minor = %d, ctx = %d, cmd = %d",
		  __entry->minor, __entry->ctx, __entry->cmd)
);

TRACE_EVENT(coda_bit_done,
	TP_PROTO(struct coda_ctx *ctx),

	TP_ARGS(ctx),

	TP_STRUCT__entry(
		__field(int, minor)
		__field(int, ctx)
	),

	TP_fast_assign(
		__entry->minor = ctx->fh.vdev->minor;
		__entry->ctx = ctx->idx;
	),

	TP_printk("minor = %d, ctx = %d", __entry->minor, __entry->ctx)
);

DECLARE_EVENT_CLASS(coda_buf_class,
	TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),

	TP_ARGS(ctx, buf),

	TP_STRUCT__entry(
		__field(int, minor)
		__field(int, index)
		__field(int, ctx)
	),

	TP_fast_assign(
		__entry->minor = ctx->fh.vdev->minor;
		__entry->index = buf->vb2_buf.index;
		__entry->ctx = ctx->idx;
	),

	TP_printk("minor = %d, index = %d, ctx = %d",
		  __entry->minor, __entry->index, __entry->ctx)
);

DEFINE_EVENT(coda_buf_class, coda_enc_pic_run,
	TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
	TP_ARGS(ctx, buf)
);

DEFINE_EVENT(coda_buf_class, coda_enc_pic_done,
	TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
	TP_ARGS(ctx, buf)
);

DECLARE_EVENT_CLASS(coda_buf_meta_class,
	TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
		 struct coda_buffer_meta *meta),

	TP_ARGS(ctx, buf, meta),

	TP_STRUCT__entry(
		__field(int, minor)
		__field(int, index)
		__field(int, start)
		__field(int, end)
		__field(int, ctx)
	),

	TP_fast_assign(
		__entry->minor = ctx->fh.vdev->minor;
		__entry->index = buf->vb2_buf.index;
		__entry->start = meta->start;
		__entry->end = meta->end;
		__entry->ctx = ctx->idx;
	),

	TP_printk("minor = %d, index = %d, start = 0x%x, end = 0x%x, ctx = %d",
		  __entry->minor, __entry->index, __entry->start, __entry->end,
		  __entry->ctx)
);

DEFINE_EVENT(coda_buf_meta_class, coda_bit_queue,
	TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
		 struct coda_buffer_meta *meta),
	TP_ARGS(ctx, buf, meta)
);

DECLARE_EVENT_CLASS(coda_meta_class,
	TP_PROTO(struct coda_ctx *ctx, struct coda_buffer_meta *meta),

	TP_ARGS(ctx, meta),

	TP_STRUCT__entry(
		__field(int, minor)
		__field(int, start)
		__field(int, end)
		__field(int, ctx)
	),

	TP_fast_assign(
		__entry->minor = ctx->fh.vdev->minor;
		__entry->start = meta ? meta->start : 0;
		__entry->end = meta ? meta->end : 0;
		__entry->ctx = ctx->idx;
	),

	TP_printk("minor = %d, start = 0x%x, end = 0x%x, ctx = %d",
		  __entry->minor, __entry->start, __entry->end, __entry->ctx)
);

DEFINE_EVENT(coda_meta_class, coda_dec_pic_run,
	TP_PROTO(struct coda_ctx *ctx, struct coda_buffer_meta *meta),
	TP_ARGS(ctx, meta)
);

DEFINE_EVENT(coda_meta_class, coda_dec_pic_done,
	TP_PROTO(struct coda_ctx *ctx, struct coda_buffer_meta *meta),
	TP_ARGS(ctx, meta)
);

DEFINE_EVENT(coda_buf_meta_class, coda_dec_rot_done,
	TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
		 struct coda_buffer_meta *meta),
	TP_ARGS(ctx, buf, meta)
);

#endif /* __CODA_TRACE_H__ */

#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace

/* This part must be outside protection */
#include <trace/define_trace.h>