Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #undef TRACE_SYSTEM
0003 #define TRACE_SYSTEM coda
0004 
0005 #if !defined(__CODA_TRACE_H__) || defined(TRACE_HEADER_MULTI_READ)
0006 #define __CODA_TRACE_H__
0007 
0008 #include <linux/tracepoint.h>
0009 #include <media/videobuf2-v4l2.h>
0010 
0011 #include "coda.h"
0012 
0013 TRACE_EVENT(coda_bit_run,
0014     TP_PROTO(struct coda_ctx *ctx, int cmd),
0015 
0016     TP_ARGS(ctx, cmd),
0017 
0018     TP_STRUCT__entry(
0019         __field(int, minor)
0020         __field(int, ctx)
0021         __field(int, cmd)
0022     ),
0023 
0024     TP_fast_assign(
0025         __entry->minor = ctx->fh.vdev->minor;
0026         __entry->ctx = ctx->idx;
0027         __entry->cmd = cmd;
0028     ),
0029 
0030     TP_printk("minor = %d, ctx = %d, cmd = %d",
0031           __entry->minor, __entry->ctx, __entry->cmd)
0032 );
0033 
0034 TRACE_EVENT(coda_bit_done,
0035     TP_PROTO(struct coda_ctx *ctx),
0036 
0037     TP_ARGS(ctx),
0038 
0039     TP_STRUCT__entry(
0040         __field(int, minor)
0041         __field(int, ctx)
0042     ),
0043 
0044     TP_fast_assign(
0045         __entry->minor = ctx->fh.vdev->minor;
0046         __entry->ctx = ctx->idx;
0047     ),
0048 
0049     TP_printk("minor = %d, ctx = %d", __entry->minor, __entry->ctx)
0050 );
0051 
0052 DECLARE_EVENT_CLASS(coda_buf_class,
0053     TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
0054 
0055     TP_ARGS(ctx, buf),
0056 
0057     TP_STRUCT__entry(
0058         __field(int, minor)
0059         __field(int, index)
0060         __field(int, ctx)
0061     ),
0062 
0063     TP_fast_assign(
0064         __entry->minor = ctx->fh.vdev->minor;
0065         __entry->index = buf->vb2_buf.index;
0066         __entry->ctx = ctx->idx;
0067     ),
0068 
0069     TP_printk("minor = %d, index = %d, ctx = %d",
0070           __entry->minor, __entry->index, __entry->ctx)
0071 );
0072 
0073 DEFINE_EVENT(coda_buf_class, coda_enc_pic_run,
0074     TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
0075     TP_ARGS(ctx, buf)
0076 );
0077 
0078 DEFINE_EVENT(coda_buf_class, coda_enc_pic_done,
0079     TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
0080     TP_ARGS(ctx, buf)
0081 );
0082 
0083 DECLARE_EVENT_CLASS(coda_buf_meta_class,
0084     TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
0085          struct coda_buffer_meta *meta),
0086 
0087     TP_ARGS(ctx, buf, meta),
0088 
0089     TP_STRUCT__entry(
0090         __field(int, minor)
0091         __field(int, index)
0092         __field(int, start)
0093         __field(int, end)
0094         __field(int, ctx)
0095     ),
0096 
0097     TP_fast_assign(
0098         __entry->minor = ctx->fh.vdev->minor;
0099         __entry->index = buf->vb2_buf.index;
0100         __entry->start = meta->start & ctx->bitstream_fifo.kfifo.mask;
0101         __entry->end = meta->end & ctx->bitstream_fifo.kfifo.mask;
0102         __entry->ctx = ctx->idx;
0103     ),
0104 
0105     TP_printk("minor = %d, index = %d, start = 0x%x, end = 0x%x, ctx = %d",
0106           __entry->minor, __entry->index, __entry->start, __entry->end,
0107           __entry->ctx)
0108 );
0109 
0110 DEFINE_EVENT(coda_buf_meta_class, coda_bit_queue,
0111     TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
0112          struct coda_buffer_meta *meta),
0113     TP_ARGS(ctx, buf, meta)
0114 );
0115 
0116 DECLARE_EVENT_CLASS(coda_meta_class,
0117     TP_PROTO(struct coda_ctx *ctx, struct coda_buffer_meta *meta),
0118 
0119     TP_ARGS(ctx, meta),
0120 
0121     TP_STRUCT__entry(
0122         __field(int, minor)
0123         __field(int, start)
0124         __field(int, end)
0125         __field(int, ctx)
0126     ),
0127 
0128     TP_fast_assign(
0129         __entry->minor = ctx->fh.vdev->minor;
0130         __entry->start = meta ? (meta->start &
0131                      ctx->bitstream_fifo.kfifo.mask) : 0;
0132         __entry->end = meta ? (meta->end &
0133                        ctx->bitstream_fifo.kfifo.mask) : 0;
0134         __entry->ctx = ctx->idx;
0135     ),
0136 
0137     TP_printk("minor = %d, start = 0x%x, end = 0x%x, ctx = %d",
0138           __entry->minor, __entry->start, __entry->end, __entry->ctx)
0139 );
0140 
0141 DEFINE_EVENT(coda_meta_class, coda_dec_pic_run,
0142     TP_PROTO(struct coda_ctx *ctx, struct coda_buffer_meta *meta),
0143     TP_ARGS(ctx, meta)
0144 );
0145 
0146 DEFINE_EVENT(coda_meta_class, coda_dec_pic_done,
0147     TP_PROTO(struct coda_ctx *ctx, struct coda_buffer_meta *meta),
0148     TP_ARGS(ctx, meta)
0149 );
0150 
0151 DEFINE_EVENT(coda_buf_meta_class, coda_dec_rot_done,
0152     TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
0153          struct coda_buffer_meta *meta),
0154     TP_ARGS(ctx, buf, meta)
0155 );
0156 
0157 DEFINE_EVENT(coda_buf_class, coda_jpeg_run,
0158     TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
0159     TP_ARGS(ctx, buf)
0160 );
0161 
0162 DEFINE_EVENT(coda_buf_class, coda_jpeg_done,
0163     TP_PROTO(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf),
0164     TP_ARGS(ctx, buf)
0165 );
0166 
0167 #endif /* __CODA_TRACE_H__ */
0168 
0169 #undef TRACE_INCLUDE_PATH
0170 #define TRACE_INCLUDE_PATH ../../drivers/media/platform/chips-media
0171 #undef TRACE_INCLUDE_FILE
0172 #define TRACE_INCLUDE_FILE trace
0173 
0174 /* This part must be outside protection */
0175 #include <trace/define_trace.h>