trace.h 4.0 KB

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