Fix: compilation warnings on 4.1-rc1 kernel
[lttng-modules.git] / instrumentation / events / lttng-module / v4l2.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM v4l2
3
4 #if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_V4L2_H
6
7 #include "../../../probes/lttng-tracepoint-event.h"
8
9 #define show_timecode_type(type) \
10 __print_symbolic(type, \
11 { V4L2_TC_TYPE_24FPS, "24FPS" }, \
12 { V4L2_TC_TYPE_25FPS, "25FPS" }, \
13 { V4L2_TC_TYPE_30FPS, "30FPS" }, \
14 { V4L2_TC_TYPE_50FPS, "50FPS" }, \
15 { V4L2_TC_TYPE_60FPS, "60FPS" })
16
17 #define show_flags(flags) \
18 __print_flags(flags, "|", \
19 { V4L2_BUF_FLAG_MAPPED, "MAPPED" }, \
20 { V4L2_BUF_FLAG_QUEUED, "QUEUED" }, \
21 { V4L2_BUF_FLAG_DONE, "DONE" }, \
22 { V4L2_BUF_FLAG_KEYFRAME, "KEYFRAME" }, \
23 { V4L2_BUF_FLAG_PFRAME, "PFRAME" }, \
24 { V4L2_BUF_FLAG_BFRAME, "BFRAME" }, \
25 { V4L2_BUF_FLAG_ERROR, "ERROR" }, \
26 { V4L2_BUF_FLAG_TIMECODE, "TIMECODE" }, \
27 { V4L2_BUF_FLAG_PREPARED, "PREPARED" }, \
28 { V4L2_BUF_FLAG_NO_CACHE_INVALIDATE, "NO_CACHE_INVALIDATE" }, \
29 { V4L2_BUF_FLAG_NO_CACHE_CLEAN, "NO_CACHE_CLEAN" }, \
30 { V4L2_BUF_FLAG_TIMESTAMP_MASK, "TIMESTAMP_MASK" }, \
31 { V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN, "TIMESTAMP_UNKNOWN" }, \
32 { V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC, "TIMESTAMP_MONOTONIC" }, \
33 { V4L2_BUF_FLAG_TIMESTAMP_COPY, "TIMESTAMP_COPY" })
34
35 #define show_timecode_flags(flags) \
36 __print_flags(flags, "|", \
37 { V4L2_TC_FLAG_DROPFRAME, "DROPFRAME" }, \
38 { V4L2_TC_FLAG_COLORFRAME, "COLORFRAME" }, \
39 { V4L2_TC_USERBITS_USERDEFINED, "USERBITS_USERDEFINED" }, \
40 { V4L2_TC_USERBITS_8BITCHARS, "USERBITS_8BITCHARS" })
41
42 #define LTTNG_TRACEPOINT_EVENT_V4L2(event_name) \
43 LTTNG_TRACEPOINT_EVENT(event_name, \
44 TP_PROTO(int minor, struct v4l2_buffer *buf), \
45 \
46 TP_ARGS(minor, buf), \
47 \
48 TP_STRUCT__entry( \
49 __field(int, minor) \
50 __field(u32, index) \
51 __field(u32, type) \
52 __field(u32, bytesused) \
53 __field(u32, flags) \
54 __field(u32, field) \
55 __field(s64, timestamp) \
56 __field(u32, timecode_type) \
57 __field(u32, timecode_flags) \
58 __field(u8, timecode_frames) \
59 __field(u8, timecode_seconds) \
60 __field(u8, timecode_minutes) \
61 __field(u8, timecode_hours) \
62 __field(u8, timecode_userbits0) \
63 __field(u8, timecode_userbits1) \
64 __field(u8, timecode_userbits2) \
65 __field(u8, timecode_userbits3) \
66 __field(u32, sequence) \
67 ), \
68 \
69 TP_fast_assign( \
70 tp_assign(minor, minor); \
71 tp_assign(index, buf->index); \
72 tp_assign(type, buf->type); \
73 tp_assign(bytesused, buf->bytesused); \
74 tp_assign(flags, buf->flags); \
75 tp_assign(field, buf->field); \
76 tp_assign(timestamp, \
77 timeval_to_ns(&buf->timestamp)); \
78 tp_assign(timecode_type, buf->timecode.type); \
79 tp_assign(timecode_flags, buf->timecode.flags); \
80 tp_assign(timecode_frames, \
81 buf->timecode.frames); \
82 tp_assign(timecode_seconds, \
83 buf->timecode.seconds); \
84 tp_assign(timecode_minutes, \
85 buf->timecode.minutes); \
86 tp_assign(timecode_hours, buf->timecode.hours); \
87 tp_assign(timecode_userbits0, \
88 buf->timecode.userbits[0]); \
89 tp_assign(timecode_userbits1, \
90 buf->timecode.userbits[1]); \
91 tp_assign(timecode_userbits2, \
92 buf->timecode.userbits[2]); \
93 tp_assign(timecode_userbits3, \
94 buf->timecode.userbits[3]); \
95 tp_assign(sequence, buf->sequence); \
96 ), \
97 \
98 TP_printk() \
99 )
100
101 LTTNG_TRACEPOINT_EVENT_V4L2(v4l2_dqbuf)
102 LTTNG_TRACEPOINT_EVENT_V4L2(v4l2_qbuf)
103
104 #endif /* if !defined(LTTNG_TRACE_V4L2_H) || defined(TRACE_HEADER_MULTI_READ) */
105
106 /* This part must be outside protection */
107 #include "../../../probes/define_trace.h"
This page took 0.032927 seconds and 4 git commands to generate.