xref: /linux/drivers/media/test-drivers/visl/visl-trace-vp8.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #if !defined(_VISL_TRACE_VP8_H_) || defined(TRACE_HEADER_MULTI_READ)
3 #define _VISL_TRACE_VP8_H_
4 
5 #include <linux/tracepoint.h>
6 #include "visl.h"
7 
8 #undef TRACE_SYSTEM
9 #define TRACE_SYSTEM visl_vp8_controls
10 
11 DECLARE_EVENT_CLASS(v4l2_ctrl_vp8_entropy_tmpl,
12 	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
13 	TP_ARGS(f),
14 	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp8_frame, f)),
15 	TP_fast_assign(__entry->f = *f;),
16 	TP_printk("\nentropy.coeff_probs {%s}\n"
17 		  "entropy.y_mode_probs %s\n"
18 		  "entropy.uv_mode_probs %s\n"
19 		  "entropy.mv_probs {%s}",
20 		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
21 				   __entry->f.entropy.coeff_probs,
22 				   sizeof(__entry->f.entropy.coeff_probs),
23 				   false),
24 		  __print_array(__entry->f.entropy.y_mode_probs,
25 				ARRAY_SIZE(__entry->f.entropy.y_mode_probs),
26 				sizeof(__entry->f.entropy.y_mode_probs[0])),
27 		  __print_array(__entry->f.entropy.uv_mode_probs,
28 				ARRAY_SIZE(__entry->f.entropy.uv_mode_probs),
29 				sizeof(__entry->f.entropy.uv_mode_probs[0])),
30 		  __print_hex_dump("", DUMP_PREFIX_NONE, 32, 1,
31 				   __entry->f.entropy.mv_probs,
32 				   sizeof(__entry->f.entropy.mv_probs),
33 				   false)
34 		  )
35 )
36 
37 DECLARE_EVENT_CLASS(v4l2_ctrl_vp8_frame_tmpl,
38 	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
39 	TP_ARGS(f),
40 	TP_STRUCT__entry(__field_struct(struct v4l2_ctrl_vp8_frame, f)),
41 	TP_fast_assign(__entry->f = *f;),
42 	TP_printk("\nsegment.quant_update %s\n"
43 		  "segment.lf_update %s\n"
44 		  "segment.segment_probs %s\n"
45 		  "segment.flags %s\n"
46 		  "lf.ref_frm_delta %s\n"
47 		  "lf.mb_mode_delta %s\n"
48 		  "lf.sharpness_level %u\n"
49 		  "lf.level %u\n"
50 		  "lf.flags %s\n"
51 		  "quant.y_ac_qi %u\n"
52 		  "quant.y_dc_delta %d\n"
53 		  "quant.y2_dc_delta %d\n"
54 		  "quant.y2_ac_delta %d\n"
55 		  "quant.uv_dc_delta %d\n"
56 		  "quant.uv_ac_delta %d\n"
57 		  "coder_state.range %u\n"
58 		  "coder_state.value %u\n"
59 		  "coder_state.bit_count %u\n"
60 		  "width %u\n"
61 		  "height %u\n"
62 		  "horizontal_scale %u\n"
63 		  "vertical_scale %u\n"
64 		  "version %u\n"
65 		  "prob_skip_false %u\n"
66 		  "prob_intra %u\n"
67 		  "prob_last %u\n"
68 		  "prob_gf %u\n"
69 		  "num_dct_parts %u\n"
70 		  "first_part_size %u\n"
71 		  "first_part_header_bits %u\n"
72 		  "dct_part_sizes %s\n"
73 		  "last_frame_ts %llu\n"
74 		  "golden_frame_ts %llu\n"
75 		  "alt_frame_ts %llu\n"
76 		  "flags %s",
77 		  __print_array(__entry->f.segment.quant_update,
78 				ARRAY_SIZE(__entry->f.segment.quant_update),
79 				sizeof(__entry->f.segment.quant_update[0])),
80 		  __print_array(__entry->f.segment.lf_update,
81 				ARRAY_SIZE(__entry->f.segment.lf_update),
82 				sizeof(__entry->f.segment.lf_update[0])),
83 		  __print_array(__entry->f.segment.segment_probs,
84 				ARRAY_SIZE(__entry->f.segment.segment_probs),
85 				sizeof(__entry->f.segment.segment_probs[0])),
86 		  __print_flags(__entry->f.segment.flags, "|",
87 		  {V4L2_VP8_SEGMENT_FLAG_ENABLED, "SEGMENT_ENABLED"},
88 		  {V4L2_VP8_SEGMENT_FLAG_UPDATE_MAP, "SEGMENT_UPDATE_MAP"},
89 		  {V4L2_VP8_SEGMENT_FLAG_UPDATE_FEATURE_DATA, "SEGMENT_UPDATE_FEATURE_DATA"},
90 		  {V4L2_VP8_SEGMENT_FLAG_DELTA_VALUE_MODE, "SEGMENT_DELTA_VALUE_MODE"}),
91 		  __print_array(__entry->f.lf.ref_frm_delta,
92 				ARRAY_SIZE(__entry->f.lf.ref_frm_delta),
93 				sizeof(__entry->f.lf.ref_frm_delta[0])),
94 		  __print_array(__entry->f.lf.mb_mode_delta,
95 				ARRAY_SIZE(__entry->f.lf.mb_mode_delta),
96 				sizeof(__entry->f.lf.mb_mode_delta[0])),
97 		  __entry->f.lf.sharpness_level,
98 		  __entry->f.lf.level,
99 		  __print_flags(__entry->f.lf.flags, "|",
100 		  {V4L2_VP8_LF_ADJ_ENABLE, "LF_ADJ_ENABLED"},
101 		  {V4L2_VP8_LF_DELTA_UPDATE, "LF_DELTA_UPDATE"},
102 		  {V4L2_VP8_LF_FILTER_TYPE_SIMPLE, "LF_FILTER_TYPE_SIMPLE"}),
103 		  __entry->f.quant.y_ac_qi,
104 		  __entry->f.quant.y_dc_delta,
105 		  __entry->f.quant.y2_dc_delta,
106 		  __entry->f.quant.y2_ac_delta,
107 		  __entry->f.quant.uv_dc_delta,
108 		  __entry->f.quant.uv_ac_delta,
109 		  __entry->f.coder_state.range,
110 		  __entry->f.coder_state.value,
111 		  __entry->f.coder_state.bit_count,
112 		  __entry->f.width,
113 		  __entry->f.height,
114 		  __entry->f.horizontal_scale,
115 		  __entry->f.vertical_scale,
116 		  __entry->f.version,
117 		  __entry->f.prob_skip_false,
118 		  __entry->f.prob_intra,
119 		  __entry->f.prob_last,
120 		  __entry->f.prob_gf,
121 		  __entry->f.num_dct_parts,
122 		  __entry->f.first_part_size,
123 		  __entry->f.first_part_header_bits,
124 		  __print_array(__entry->f.dct_part_sizes,
125 				ARRAY_SIZE(__entry->f.dct_part_sizes),
126 				sizeof(__entry->f.dct_part_sizes[0])),
127 		  __entry->f.last_frame_ts,
128 		  __entry->f.golden_frame_ts,
129 		  __entry->f.alt_frame_ts,
130 		  __print_flags(__entry->f.flags, "|",
131 		  {V4L2_VP8_FRAME_FLAG_KEY_FRAME, "KEY_FRAME"},
132 		  {V4L2_VP8_FRAME_FLAG_EXPERIMENTAL, "EXPERIMENTAL"},
133 		  {V4L2_VP8_FRAME_FLAG_SHOW_FRAME, "SHOW_FRAME"},
134 		  {V4L2_VP8_FRAME_FLAG_MB_NO_SKIP_COEFF, "MB_NO_SKIP_COEFF"},
135 		  {V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN, "SIGN_BIAS_GOLDEN"},
136 		  {V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT, "SIGN_BIAS_ALT"})
137 		  )
138 );
139 
140 DEFINE_EVENT(v4l2_ctrl_vp8_frame_tmpl, v4l2_ctrl_vp8_frame,
141 	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
142 	TP_ARGS(f)
143 );
144 
145 DEFINE_EVENT(v4l2_ctrl_vp8_entropy_tmpl, v4l2_ctrl_vp8_entropy,
146 	TP_PROTO(const struct v4l2_ctrl_vp8_frame *f),
147 	TP_ARGS(f)
148 );
149 
150 #endif
151 
152 #undef TRACE_INCLUDE_PATH
153 #undef TRACE_INCLUDE_FILE
154 #define TRACE_INCLUDE_PATH ../../drivers/media/test-drivers/visl
155 #define TRACE_INCLUDE_FILE visl-trace-vp8
156 #include <trace/define_trace.h>
157