vb2.h 1.6 KB

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