trace.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. #undef TRACE_SYSTEM
  2. #define TRACE_SYSTEM coda
  3. #if !defined(__CODA_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
  4. #define __CODA_TRACE_H__
  5. #include <linux/tracepoint.h>
  6. #include <media/videobuf2-v4l2.h>
  7. #include "coda.h"
  8. TRACE_EVENT(coda_bit_run,
  9. TP_PROTO(struct coda_ctx *ctx, int cmd),
  10. TP_ARGS(ctx, cmd),
  11. TP_STRUCT__entry(
  12. __field(int, minor)
  13. __field(int, ctx)
  14. __field(int, cmd)
  15. ),
  16. TP_fast_assign(
  17. __entry->minor = ctx->fh.vdev->minor;
  18. __entry->ctx = ctx->idx;
  19. __entry->cmd = cmd;
  20. ),
  21. TP_printk("minor = %d, ctx = %d, cmd = %d",
  22. __entry->minor, __entry->ctx, __entry->cmd)
  23. );
  24. TRACE_EVENT(coda_bit_done,
  25. TP_PROTO(struct coda_ctx *ctx),
  26. TP_ARGS(ctx),
  27. TP_STRUCT__entry(
  28. __field(int, minor)
  29. __field(int, ctx)
  30. ),
  31. TP_fast_assign(
  32. __entry->minor = ctx->fh.vdev->minor;
  33. __entry->ctx = ctx->idx;
  34. ),
  35. TP_printk("minor = %d, ctx = %d", __entry->minor, __entry->ctx)
  36. );
  37. DECLARE_EVENT_CLASS(coda_buf_class,
  38. TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
  39. TP_ARGS(ctx, buf),
  40. TP_STRUCT__entry(
  41. __field(int, minor)
  42. __field(int, index)
  43. __field(int, ctx)
  44. ),
  45. TP_fast_assign(
  46. __entry->minor = ctx->fh.vdev->minor;
  47. __entry->index = buf->vb2_buf.index;
  48. __entry->ctx = ctx->idx;
  49. ),
  50. TP_printk("minor = %d, index = %d, ctx = %d",
  51. __entry->minor, __entry->index, __entry->ctx)
  52. );
  53. DEFINE_EVENT(coda_buf_class, coda_enc_pic_run,
  54. TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
  55. TP_ARGS(ctx, buf)
  56. );
  57. DEFINE_EVENT(coda_buf_class, coda_enc_pic_done,
  58. TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
  59. TP_ARGS(ctx, buf)
  60. );
  61. DECLARE_EVENT_CLASS(coda_buf_meta_class,
  62. TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
  63. struct coda_buffer_meta *meta),
  64. TP_ARGS(ctx, buf, meta),
  65. TP_STRUCT__entry(
  66. __field(int, minor)
  67. __field(int, index)
  68. __field(int, start)
  69. __field(int, end)
  70. __field(int, ctx)
  71. ),
  72. TP_fast_assign(
  73. __entry->minor = ctx->fh.vdev->minor;
  74. __entry->index = buf->vb2_buf.index;
  75. __entry->start = meta->start;
  76. __entry->end = meta->end;
  77. __entry->ctx = ctx->idx;
  78. ),
  79. TP_printk("minor = %d, index = %d, start = 0x%x, end = 0x%x, ctx = %d",
  80. __entry->minor, __entry->index, __entry->start, __entry->end,
  81. __entry->ctx)
  82. );
  83. DEFINE_EVENT(coda_buf_meta_class, coda_bit_queue,
  84. TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
  85. struct coda_buffer_meta *meta),
  86. TP_ARGS(ctx, buf, meta)
  87. );
  88. DECLARE_EVENT_CLASS(coda_meta_class,
  89. TP_PROTO(struct coda_ctx *ctx, struct coda_buffer_meta *meta),
  90. TP_ARGS(ctx, meta),
  91. TP_STRUCT__entry(
  92. __field(int, minor)
  93. __field(int, start)
  94. __field(int, end)
  95. __field(int, ctx)
  96. ),
  97. TP_fast_assign(
  98. __entry->minor = ctx->fh.vdev->minor;
  99. __entry->start = meta ? meta->start : 0;
  100. __entry->end = meta ? meta->end : 0;
  101. __entry->ctx = ctx->idx;
  102. ),
  103. TP_printk("minor = %d, start = 0x%x, end = 0x%x, ctx = %d",
  104. __entry->minor, __entry->start, __entry->end, __entry->ctx)
  105. );
  106. DEFINE_EVENT(coda_meta_class, coda_dec_pic_run,
  107. TP_PROTO(struct coda_ctx *ctx, struct coda_buffer_meta *meta),
  108. TP_ARGS(ctx, meta)
  109. );
  110. DEFINE_EVENT(coda_meta_class, coda_dec_pic_done,
  111. TP_PROTO(struct coda_ctx *ctx, struct coda_buffer_meta *meta),
  112. TP_ARGS(ctx, meta)
  113. );
  114. DEFINE_EVENT(coda_buf_meta_class, coda_dec_rot_done,
  115. TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
  116. struct coda_buffer_meta *meta),
  117. TP_ARGS(ctx, buf, meta)
  118. );
  119. #endif /* __CODA_TRACE_H__ */
  120. #undef TRACE_INCLUDE_PATH
  121. #define TRACE_INCLUDE_PATH .
  122. #undef TRACE_INCLUDE_FILE
  123. #define TRACE_INCLUDE_FILE trace
  124. /* This part must be outside protection */
  125. #include <trace/define_trace.h>