fix: media: v4l2: abstract timeval handling in v4l2_buffer (v5.6)
[lttng-modules.git] / instrumentation / events / lttng-module / v4l2.h
index 696f226f6d2f0e982a92f22fb40a774c93133c19..95fe787e269ed821dfbb2c96512486c52f5d9b31 100644 (file)
@@ -4,8 +4,34 @@
 #if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ)
 #define LTTNG_TRACE_V4L2_H
 
-#include "../../../probes/lttng-tracepoint-event.h"
+#include <probes/lttng-tracepoint-event.h>
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,6,0))
+LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class,
+
+       TP_PROTO(int minor, struct v4l2_buffer *buf),
+
+       TP_ARGS(minor, buf),
+
+       TP_FIELDS(
+               ctf_integer(int, minor, minor)
+               ctf_integer(u32, index, buf->index)
+               ctf_integer(u32, type, buf->type)
+               ctf_integer(u32, bytesused, buf->bytesused)
+               ctf_integer(u32, flags, buf->flags)
+               ctf_integer(u32, field, buf->field)
+               ctf_integer(s64, timestamp, v4l2_buffer_get_timestamp(buf))
+               ctf_integer(u32, timecode_type, buf->timecode.type)
+               ctf_integer(u32, timecode_flags, buf->timecode.flags)
+               ctf_integer(u8, timecode_frames, buf->timecode.frames)
+               ctf_integer(u8, timecode_seconds, buf->timecode.seconds)
+               ctf_integer(u8, timecode_minutes, buf->timecode.minutes)
+               ctf_integer(u8, timecode_hours, buf->timecode.hours)
+               ctf_array(u8, timecode_userbits, buf->timecode.userbits, 4)
+               ctf_integer(u32, sequence, buf->sequence)
+       )
+)
+#else
 LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class,
 
        TP_PROTO(int minor, struct v4l2_buffer *buf),
@@ -30,6 +56,7 @@ LTTNG_TRACEPOINT_EVENT_CLASS(v4l2_class,
                ctf_integer(u32, sequence, buf->sequence)
        )
 )
+#endif
 
 LTTNG_TRACEPOINT_EVENT_INSTANCE(v4l2_class,
        v4l2_dqbuf,
@@ -51,4 +78,4 @@ LTTNG_TRACEPOINT_EVENT_INSTANCE(v4l2_class,
 #endif /* if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */
 
 /* This part must be outside protection */
-#include "../../../probes/define_trace.h"
+#include <probes/define_trace.h>
This page took 0.02435 seconds and 4 git commands to generate.