vb2.h 1.7 KB

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