Commit | Line | Data |
---|---|---|
9f36eaed | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
e09a6084 WF |
2 | #undef TRACE_SYSTEM |
3 | #define TRACE_SYSTEM v4l2 | |
4 | ||
3bc29f0a MD |
5 | #if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) |
6 | #define LTTNG_TRACE_V4L2_H | |
e09a6084 | 7 | |
6ec43db8 | 8 | #include <probes/lttng-tracepoint-event.h> |
e09a6084 | 9 | |
2d042821 | 10 | #if (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(5,6,0)) |
27eca1b2 MJ |
11 | LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class, |
12 | ||
13 | TP_PROTO(int minor, struct v4l2_buffer *buf), | |
14 | ||
15 | TP_ARGS(minor, buf), | |
16 | ||
17 | TP_FIELDS( | |
18 | ctf_integer(int, minor, minor) | |
19 | ctf_integer(u32, index, buf->index) | |
20 | ctf_integer(u32, type, buf->type) | |
21 | ctf_integer(u32, bytesused, buf->bytesused) | |
22 | ctf_integer(u32, flags, buf->flags) | |
23 | ctf_integer(u32, field, buf->field) | |
24 | ctf_integer(s64, timestamp, v4l2_buffer_get_timestamp(buf)) | |
25 | ctf_integer(u32, timecode_type, buf->timecode.type) | |
26 | ctf_integer(u32, timecode_flags, buf->timecode.flags) | |
27 | ctf_integer(u8, timecode_frames, buf->timecode.frames) | |
28 | ctf_integer(u8, timecode_seconds, buf->timecode.seconds) | |
29 | ctf_integer(u8, timecode_minutes, buf->timecode.minutes) | |
30 | ctf_integer(u8, timecode_hours, buf->timecode.hours) | |
31 | ctf_array(u8, timecode_userbits, buf->timecode.userbits, 4) | |
32 | ctf_integer(u32, sequence, buf->sequence) | |
33 | ) | |
34 | ) | |
35 | #else | |
f127e61e MD |
36 | LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class, |
37 | ||
38 | TP_PROTO(int minor, struct v4l2_buffer *buf), | |
39 | ||
40 | TP_ARGS(minor, buf), | |
41 | ||
42 | TP_FIELDS( | |
43 | ctf_integer(int, minor, minor) | |
44 | ctf_integer(u32, index, buf->index) | |
45 | ctf_integer(u32, type, buf->type) | |
46 | ctf_integer(u32, bytesused, buf->bytesused) | |
47 | ctf_integer(u32, flags, buf->flags) | |
48 | ctf_integer(u32, field, buf->field) | |
49 | ctf_integer(s64, timestamp, timeval_to_ns(&buf->timestamp)) | |
50 | ctf_integer(u32, timecode_type, buf->timecode.type) | |
51 | ctf_integer(u32, timecode_flags, buf->timecode.flags) | |
52 | ctf_integer(u8, timecode_frames, buf->timecode.frames) | |
53 | ctf_integer(u8, timecode_seconds, buf->timecode.seconds) | |
54 | ctf_integer(u8, timecode_minutes, buf->timecode.minutes) | |
55 | ctf_integer(u8, timecode_hours, buf->timecode.hours) | |
56 | ctf_array(u8, timecode_userbits, buf->timecode.userbits, 4) | |
57 | ctf_integer(u32, sequence, buf->sequence) | |
58 | ) | |
59 | ) | |
27eca1b2 | 60 | #endif |
e09a6084 | 61 | |
f127e61e MD |
62 | LTTNG_TRACEPOINT_EVENT_INSTANCE(v4l2_class, |
63 | v4l2_dqbuf, | |
e09a6084 | 64 | |
f127e61e | 65 | TP_PROTO(int minor, struct v4l2_buffer *buf), |
e09a6084 | 66 | |
f127e61e MD |
67 | TP_ARGS(minor, buf) |
68 | ) | |
e09a6084 | 69 | |
f127e61e MD |
70 | LTTNG_TRACEPOINT_EVENT_INSTANCE(v4l2_class, |
71 | ||
72 | v4l2_qbuf, | |
73 | ||
74 | TP_PROTO(int minor, struct v4l2_buffer *buf), | |
e09a6084 | 75 | |
f127e61e MD |
76 | TP_ARGS(minor, buf) |
77 | ) | |
e09a6084 | 78 | |
3bc29f0a | 79 | #endif /* if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */ |
e09a6084 WF |
80 | |
81 | /* This part must be outside protection */ | |
6ec43db8 | 82 | #include <probes/define_trace.h> |