1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM printk
5 #if !defined(LTTNG_TRACE_PRINTK_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define LTTNG_TRACE_PRINTK_H
8 #include <probes/lttng-tracepoint-event.h>
9 #include <linux/version.h>
11 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
13 LTTNG_TRACEPOINT_EVENT_MAP(console
,
17 TP_PROTO(const char *text
, size_t len
),
22 ctf_sequence_text(char, msg
, text
, size_t, len
)
26 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
28 LTTNG_TRACEPOINT_EVENT_MAP(console
,
32 TP_PROTO(const char *log_buf
, unsigned start
, unsigned end
,
33 unsigned log_buf_len
),
35 TP_ARGS(log_buf
, start
, end
, log_buf_len
),
38 ctf_sequence_text(char, msg
, log_buf
+ start
,
43 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
45 LTTNG_TRACEPOINT_EVENT_MAP(console
,
49 TP_PROTO(const char *log_buf
, unsigned start
, unsigned end
,
50 unsigned log_buf_len
),
52 TP_ARGS(log_buf
, start
, end
, log_buf_len
),
56 * printk buffer is gathered from two segments on older kernels.
58 ctf_sequence_text(char, msg1
,
59 log_buf
+ (start
& (log_buf_len
- 1)),
60 size_t, (start
& (log_buf_len
- 1)) > (end
& (log_buf_len
- 1))
61 ? log_buf_len
- (start
& (log_buf_len
- 1))
63 ctf_sequence_text(char, msg2
,
65 size_t, (start
& (log_buf_len
- 1)) > (end
& (log_buf_len
- 1))
66 ? end
& (log_buf_len
- 1)
73 #endif /* LTTNG_TRACE_PRINTK_H */
75 /* This part must be outside protection */
76 #include <probes/define_trace.h>
This page took 0.029842 seconds and 4 git commands to generate.