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