488ac5b59c8b19aab1f370a0c6e15f88b6514eec
[lttng-modules.git] / instrumentation / events / lttng-module / printk.h
1 #undef TRACE_SYSTEM
2 #define TRACE_SYSTEM printk
3
4 #if !defined(LTTNG_TRACE_PRINTK_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_PRINTK_H
6
7 #include "../../../probes/lttng-tracepoint-event.h"
8 #include <linux/version.h>
9
10 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
11
12 LTTNG_TRACEPOINT_EVENT_MAP(console,
13
14 printk_console,
15
16 TP_PROTO(const char *text, size_t len),
17
18 TP_ARGS(text, len),
19
20 TP_FIELDS(
21 ctf_sequence_text(char, msg, text, size_t, len)
22 )
23 )
24
25 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
26
27 LTTNG_TRACEPOINT_EVENT_MAP(console,
28
29 printk_console,
30
31 TP_PROTO(const char *log_buf, unsigned start, unsigned end,
32 unsigned log_buf_len),
33
34 TP_ARGS(log_buf, start, end, log_buf_len),
35
36 TP_FIELDS(
37 ctf_sequence_text(char, msg, log_buf + start,
38 size_t, end - start)
39 )
40 )
41
42 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
43
44 LTTNG_TRACEPOINT_EVENT_MAP(console,
45
46 printk_console,
47
48 TP_PROTO(const char *log_buf, unsigned start, unsigned end,
49 unsigned log_buf_len),
50
51 TP_ARGS(log_buf, start, end, log_buf_len),
52
53 TP_FIELDS(
54 /*
55 * printk buffer is gathered from two segments on older kernels.
56 */
57 ctf_sequence_text(char, msg1,
58 log_buf + (start & (log_buf_len - 1)),
59 size_t, (start & (log_buf_len - 1)) > (end & (log_buf_len - 1))
60 ? log_buf_len - (start & (log_buf_len - 1))
61 : end - start)
62 ctf_sequence_text(char, msg2,
63 log_buf,
64 size_t, (start & (log_buf_len - 1)) > (end & (log_buf_len - 1))
65 ? end & (log_buf_len - 1)
66 : 0)
67 )
68 )
69
70 #endif
71
72 #endif /* LTTNG_TRACE_PRINTK_H */
73
74 /* This part must be outside protection */
75 #include "../../../probes/define_trace.h"
This page took 0.046317 seconds and 4 git commands to generate.