diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2015-07-10 09:49:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-07-17 10:58:15 -0400 |
commit | 85efe4e5082c381262f5303d20f808ac455b028e (patch) | |
tree | 09322eff1eab03996ba47dafcae28d73d2ec1811 | |
parent | 6727d4fce95586e60922bdaf57b8a0eb99482557 (diff) |
[media] v4l2-dev: use event class to deduplicate v4l2 trace events
Trace events with exactly the same parameters and trace output, such as
v4l2_qbuf and v4l2_dqbuf, are supposed to use the DECLARE_EVENT_CLASS and
DEFINE_EVENT macros instead of duplicated TRACE_EVENT macro calls.
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | include/trace/events/v4l2.h | 160 |
1 files changed, 78 insertions, 82 deletions
diff --git a/include/trace/events/v4l2.h b/include/trace/events/v4l2.h index 89d0497c058a..4c88a3241c18 100644 --- a/include/trace/events/v4l2.h +++ b/include/trace/events/v4l2.h | |||
@@ -93,90 +93,86 @@ SHOW_FIELD | |||
93 | { V4L2_TC_USERBITS_USERDEFINED, "USERBITS_USERDEFINED" }, \ | 93 | { V4L2_TC_USERBITS_USERDEFINED, "USERBITS_USERDEFINED" }, \ |
94 | { V4L2_TC_USERBITS_8BITCHARS, "USERBITS_8BITCHARS" }) | 94 | { V4L2_TC_USERBITS_8BITCHARS, "USERBITS_8BITCHARS" }) |
95 | 95 | ||
96 | #define V4L2_TRACE_EVENT(event_name) \ | 96 | DECLARE_EVENT_CLASS(v4l2_event_class, |
97 | TRACE_EVENT(event_name, \ | 97 | TP_PROTO(int minor, struct v4l2_buffer *buf), |
98 | TP_PROTO(int minor, struct v4l2_buffer *buf), \ | 98 | |
99 | \ | 99 | TP_ARGS(minor, buf), |
100 | TP_ARGS(minor, buf), \ | 100 | |
101 | \ | 101 | TP_STRUCT__entry( |
102 | TP_STRUCT__entry( \ | 102 | __field(int, minor) |
103 | __field(int, minor) \ | 103 | __field(u32, index) |
104 | __field(u32, index) \ | 104 | __field(u32, type) |
105 | __field(u32, type) \ | 105 | __field(u32, bytesused) |
106 | __field(u32, bytesused) \ | 106 | __field(u32, flags) |
107 | __field(u32, flags) \ | 107 | __field(u32, field) |
108 | __field(u32, field) \ | 108 | __field(s64, timestamp) |
109 | __field(s64, timestamp) \ | 109 | __field(u32, timecode_type) |
110 | __field(u32, timecode_type) \ | 110 | __field(u32, timecode_flags) |
111 | __field(u32, timecode_flags) \ | 111 | __field(u8, timecode_frames) |
112 | __field(u8, timecode_frames) \ | 112 | __field(u8, timecode_seconds) |
113 | __field(u8, timecode_seconds) \ | 113 | __field(u8, timecode_minutes) |
114 | __field(u8, timecode_minutes) \ | 114 | __field(u8, timecode_hours) |
115 | __field(u8, timecode_hours) \ | 115 | __field(u8, timecode_userbits0) |
116 | __field(u8, timecode_userbits0) \ | 116 | __field(u8, timecode_userbits1) |
117 | __field(u8, timecode_userbits1) \ | 117 | __field(u8, timecode_userbits2) |
118 | __field(u8, timecode_userbits2) \ | 118 | __field(u8, timecode_userbits3) |
119 | __field(u8, timecode_userbits3) \ | 119 | __field(u32, sequence) |
120 | __field(u32, sequence) \ | 120 | ), |
121 | ), \ | 121 | |
122 | \ | 122 | TP_fast_assign( |
123 | TP_fast_assign( \ | 123 | __entry->minor = minor; |
124 | __entry->minor = minor; \ | 124 | __entry->index = buf->index; |
125 | __entry->index = buf->index; \ | 125 | __entry->type = buf->type; |
126 | __entry->type = buf->type; \ | 126 | __entry->bytesused = buf->bytesused; |
127 | __entry->bytesused = buf->bytesused; \ | 127 | __entry->flags = buf->flags; |
128 | __entry->flags = buf->flags; \ | 128 | __entry->field = buf->field; |
129 | __entry->field = buf->field; \ | 129 | __entry->timestamp = timeval_to_ns(&buf->timestamp); |
130 | __entry->timestamp = \ | 130 | __entry->timecode_type = buf->timecode.type; |
131 | timeval_to_ns(&buf->timestamp); \ | 131 | __entry->timecode_flags = buf->timecode.flags; |
132 | __entry->timecode_type = buf->timecode.type; \ | 132 | __entry->timecode_frames = buf->timecode.frames; |
133 | __entry->timecode_flags = buf->timecode.flags; \ | 133 | __entry->timecode_seconds = buf->timecode.seconds; |
134 | __entry->timecode_frames = \ | 134 | __entry->timecode_minutes = buf->timecode.minutes; |
135 | buf->timecode.frames; \ | 135 | __entry->timecode_hours = buf->timecode.hours; |
136 | __entry->timecode_seconds = \ | 136 | __entry->timecode_userbits0 = buf->timecode.userbits[0]; |
137 | buf->timecode.seconds; \ | 137 | __entry->timecode_userbits1 = buf->timecode.userbits[1]; |
138 | __entry->timecode_minutes = \ | 138 | __entry->timecode_userbits2 = buf->timecode.userbits[2]; |
139 | buf->timecode.minutes; \ | 139 | __entry->timecode_userbits3 = buf->timecode.userbits[3]; |
140 | __entry->timecode_hours = buf->timecode.hours; \ | 140 | __entry->sequence = buf->sequence; |
141 | __entry->timecode_userbits0 = \ | 141 | ), |
142 | buf->timecode.userbits[0]; \ | 142 | |
143 | __entry->timecode_userbits1 = \ | 143 | TP_printk("minor = %d, index = %u, type = %s, bytesused = %u, " |
144 | buf->timecode.userbits[1]; \ | 144 | "flags = %s, field = %s, timestamp = %llu, " |
145 | __entry->timecode_userbits2 = \ | 145 | "timecode = { type = %s, flags = %s, frames = %u, " |
146 | buf->timecode.userbits[2]; \ | 146 | "seconds = %u, minutes = %u, hours = %u, " |
147 | __entry->timecode_userbits3 = \ | 147 | "userbits = { %u %u %u %u } }, sequence = %u", __entry->minor, |
148 | buf->timecode.userbits[3]; \ | 148 | __entry->index, show_type(__entry->type), |
149 | __entry->sequence = buf->sequence; \ | 149 | __entry->bytesused, |
150 | ), \ | 150 | show_flags(__entry->flags), |
151 | \ | 151 | show_field(__entry->field), |
152 | TP_printk("minor = %d, index = %u, type = %s, " \ | 152 | __entry->timestamp, |
153 | "bytesused = %u, flags = %s, " \ | 153 | show_timecode_type(__entry->timecode_type), |
154 | "field = %s, timestamp = %llu, timecode = { " \ | 154 | show_timecode_flags(__entry->timecode_flags), |
155 | "type = %s, flags = %s, frames = %u, " \ | 155 | __entry->timecode_frames, |
156 | "seconds = %u, minutes = %u, hours = %u, " \ | 156 | __entry->timecode_seconds, |
157 | "userbits = { %u %u %u %u } }, " \ | 157 | __entry->timecode_minutes, |
158 | "sequence = %u", __entry->minor, \ | 158 | __entry->timecode_hours, |
159 | __entry->index, show_type(__entry->type), \ | 159 | __entry->timecode_userbits0, |
160 | __entry->bytesused, \ | 160 | __entry->timecode_userbits1, |
161 | show_flags(__entry->flags), \ | 161 | __entry->timecode_userbits2, |
162 | show_field(__entry->field), \ | 162 | __entry->timecode_userbits3, |
163 | __entry->timestamp, \ | 163 | __entry->sequence |
164 | show_timecode_type(__entry->timecode_type), \ | ||
165 | show_timecode_flags(__entry->timecode_flags), \ | ||
166 | __entry->timecode_frames, \ | ||
167 | __entry->timecode_seconds, \ | ||
168 | __entry->timecode_minutes, \ | ||
169 | __entry->timecode_hours, \ | ||
170 | __entry->timecode_userbits0, \ | ||
171 | __entry->timecode_userbits1, \ | ||
172 | __entry->timecode_userbits2, \ | ||
173 | __entry->timecode_userbits3, \ | ||
174 | __entry->sequence \ | ||
175 | ) \ | ||
176 | ) | 164 | ) |
165 | ) | ||
177 | 166 | ||
178 | V4L2_TRACE_EVENT(v4l2_dqbuf); | 167 | DEFINE_EVENT(v4l2_event_class, v4l2_dqbuf, |
179 | V4L2_TRACE_EVENT(v4l2_qbuf); | 168 | TP_PROTO(int minor, struct v4l2_buffer *buf), |
169 | TP_ARGS(minor, buf) | ||
170 | ); | ||
171 | |||
172 | DEFINE_EVENT(v4l2_event_class, v4l2_qbuf, | ||
173 | TP_PROTO(int minor, struct v4l2_buffer *buf), | ||
174 | TP_ARGS(minor, buf) | ||
175 | ); | ||
180 | 176 | ||
181 | #endif /* if !defined(_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */ | 177 | #endif /* if !defined(_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */ |
182 | 178 | ||