summaryrefslogtreecommitdiffstats
path: root/include/trace
diff options
context:
space:
mode:
authorPhilipp Zabel <p.zabel@pengutronix.de>2015-07-10 09:49:26 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-07-17 11:04:12 -0400
commit2091f5181c66b3617a977e79843aba10e087be6c (patch)
tree69052ff35a8795ff3c17904ebe59ad5949f58d60 /include/trace
parentc13a5ccf5da86239213033214658b8a170eeab87 (diff)
[media] videobuf2: add trace events
Add videobuf2 specific vb2_qbuf and vb2_dqbuf trace events that mirror the v4l2_qbuf and v4l2_dqbuf trace events, only they include additional information about queue fill state and are emitted right before the buffer is enqueued in the driver or userspace is woken up. This allows to make sense of the timeline of trace events in combination with others that might be triggered by __enqueue_in_driver. Also two new trace events vb2_buf_queue and vb2_buf_done are added, allowing to trace the handover between videobuf2 framework and driver. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> 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.h97
1 files changed, 97 insertions, 0 deletions
diff --git a/include/trace/events/v4l2.h b/include/trace/events/v4l2.h
index 4c88a3241c18..dbf017bfddd9 100644
--- a/include/trace/events/v4l2.h
+++ b/include/trace/events/v4l2.h
@@ -174,6 +174,103 @@ DEFINE_EVENT(v4l2_event_class, v4l2_qbuf,
174 TP_ARGS(minor, buf) 174 TP_ARGS(minor, buf)
175); 175);
176 176
177DECLARE_EVENT_CLASS(vb2_event_class,
178 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
179 TP_ARGS(q, vb),
180
181 TP_STRUCT__entry(
182 __field(int, minor)
183 __field(u32, queued_count)
184 __field(int, owned_by_drv_count)
185 __field(u32, index)
186 __field(u32, type)
187 __field(u32, bytesused)
188 __field(u32, flags)
189 __field(u32, field)
190 __field(s64, timestamp)
191 __field(u32, timecode_type)
192 __field(u32, timecode_flags)
193 __field(u8, timecode_frames)
194 __field(u8, timecode_seconds)
195 __field(u8, timecode_minutes)
196 __field(u8, timecode_hours)
197 __field(u8, timecode_userbits0)
198 __field(u8, timecode_userbits1)
199 __field(u8, timecode_userbits2)
200 __field(u8, timecode_userbits3)
201 __field(u32, sequence)
202 ),
203
204 TP_fast_assign(
205 __entry->minor = q->owner ? q->owner->vdev->minor : -1;
206 __entry->queued_count = q->queued_count;
207 __entry->owned_by_drv_count =
208 atomic_read(&q->owned_by_drv_count);
209 __entry->index = vb->v4l2_buf.index;
210 __entry->type = vb->v4l2_buf.type;
211 __entry->bytesused = vb->v4l2_planes[0].bytesused;
212 __entry->flags = vb->v4l2_buf.flags;
213 __entry->field = vb->v4l2_buf.field;
214 __entry->timestamp = timeval_to_ns(&vb->v4l2_buf.timestamp);
215 __entry->timecode_type = vb->v4l2_buf.timecode.type;
216 __entry->timecode_flags = vb->v4l2_buf.timecode.flags;
217 __entry->timecode_frames = vb->v4l2_buf.timecode.frames;
218 __entry->timecode_seconds = vb->v4l2_buf.timecode.seconds;
219 __entry->timecode_minutes = vb->v4l2_buf.timecode.minutes;
220 __entry->timecode_hours = vb->v4l2_buf.timecode.hours;
221 __entry->timecode_userbits0 = vb->v4l2_buf.timecode.userbits[0];
222 __entry->timecode_userbits1 = vb->v4l2_buf.timecode.userbits[1];
223 __entry->timecode_userbits2 = vb->v4l2_buf.timecode.userbits[2];
224 __entry->timecode_userbits3 = vb->v4l2_buf.timecode.userbits[3];
225 __entry->sequence = vb->v4l2_buf.sequence;
226 ),
227
228 TP_printk("minor = %d, queued = %u, owned_by_drv = %d, index = %u, "
229 "type = %s, bytesused = %u, flags = %s, field = %s, "
230 "timestamp = %llu, timecode = { type = %s, flags = %s, "
231 "frames = %u, seconds = %u, minutes = %u, hours = %u, "
232 "userbits = { %u %u %u %u } }, sequence = %u", __entry->minor,
233 __entry->queued_count,
234 __entry->owned_by_drv_count,
235 __entry->index, show_type(__entry->type),
236 __entry->bytesused,
237 show_flags(__entry->flags),
238 show_field(__entry->field),
239 __entry->timestamp,
240 show_timecode_type(__entry->timecode_type),
241 show_timecode_flags(__entry->timecode_flags),
242 __entry->timecode_frames,
243 __entry->timecode_seconds,
244 __entry->timecode_minutes,
245 __entry->timecode_hours,
246 __entry->timecode_userbits0,
247 __entry->timecode_userbits1,
248 __entry->timecode_userbits2,
249 __entry->timecode_userbits3,
250 __entry->sequence
251 )
252)
253
254DEFINE_EVENT(vb2_event_class, vb2_buf_done,
255 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
256 TP_ARGS(q, vb)
257);
258
259DEFINE_EVENT(vb2_event_class, vb2_buf_queue,
260 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
261 TP_ARGS(q, vb)
262);
263
264DEFINE_EVENT(vb2_event_class, vb2_dqbuf,
265 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
266 TP_ARGS(q, vb)
267);
268
269DEFINE_EVENT(vb2_event_class, vb2_qbuf,
270 TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
271 TP_ARGS(q, vb)
272);
273
177#endif /* if !defined(_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */ 274#endif /* if !defined(_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */
178 275
179/* This part must be outside protection */ 276/* This part must be outside protection */