vb2.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. __field(u64, timestamp)
  18. ),
  19. TP_fast_assign(
  20. __entry->owner = q->owner;
  21. __entry->queued_count = q->queued_count;
  22. __entry->owned_by_drv_count =
  23. atomic_read(&q->owned_by_drv_count);
  24. __entry->index = vb->index;
  25. __entry->type = vb->type;
  26. __entry->bytesused = vb->planes[0].bytesused;
  27. __entry->timestamp = vb->timestamp;
  28. ),
  29. TP_printk("owner = %p, queued = %u, owned_by_drv = %d, index = %u, "
  30. "type = %u, bytesused = %u, timestamp = %llu", __entry->owner,
  31. __entry->queued_count,
  32. __entry->owned_by_drv_count,
  33. __entry->index, __entry->type,
  34. __entry->bytesused,
  35. __entry->timestamp
  36. )
  37. )
  38. DEFINE_EVENT(vb2_event_class, vb2_buf_done,
  39. TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
  40. TP_ARGS(q, vb)
  41. );
  42. DEFINE_EVENT(vb2_event_class, vb2_buf_queue,
  43. TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
  44. TP_ARGS(q, vb)
  45. );
  46. DEFINE_EVENT(vb2_event_class, vb2_dqbuf,
  47. TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
  48. TP_ARGS(q, vb)
  49. );
  50. DEFINE_EVENT(vb2_event_class, vb2_qbuf,
  51. TP_PROTO(struct vb2_queue *q, struct vb2_buffer *vb),
  52. TP_ARGS(q, vb)
  53. );
  54. #endif /* if !defined(_TRACE_VB2_H) || defined(TRACE_HEADER_MULTI_READ) */
  55. /* This part must be outside protection */
  56. #include <trace/define_trace.h>