2 #define TRACE_SYSTEM printk
4 #if !defined(LTTNG_TRACE_PRINTK_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define LTTNG_TRACE_PRINTK_H
7 #include "../../../probes/lttng-tracepoint-event.h"
8 #include <linux/version.h>
10 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
12 LTTNG_TRACEPOINT_EVENT(console
,
13 TP_PROTO(const char *text
, size_t len
),
18 __dynamic_array_text(char, msg
, len
)
22 tp_memcpy_dyn(msg
, text
)
25 TP_printk("%s", __get_str(msg
))
28 #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
30 LTTNG_TRACEPOINT_EVENT_CONDITION(console
,
31 TP_PROTO(const char *log_buf
, unsigned start
, unsigned end
,
32 unsigned log_buf_len
),
34 TP_ARGS(log_buf
, start
, end
, log_buf_len
),
36 TP_CONDITION(start
!= end
),
39 __dynamic_array_text(char, msg
, end
- start
)
43 tp_memcpy_dyn(msg
, log_buf
+ start
)
46 TP_printk("%s", __get_str(msg
))
49 #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */
51 LTTNG_TRACEPOINT_EVENT_CONDITION(console
,
52 TP_PROTO(const char *log_buf
, unsigned start
, unsigned end
,
53 unsigned log_buf_len
),
55 TP_ARGS(log_buf
, start
, end
, log_buf_len
),
57 TP_CONDITION(start
!= end
),
60 __dynamic_array_text_2(char, msg
,
61 (start
& (log_buf_len
- 1)) > (end
& (log_buf_len
- 1))
62 ? log_buf_len
- (start
& (log_buf_len
- 1))
64 (start
& (log_buf_len
- 1)) > (end
& (log_buf_len
- 1))
65 ? end
& (log_buf_len
- 1)
71 log_buf
+ (start
& (log_buf_len
- 1)),
75 TP_printk("%s", __get_str(msg
))
80 #endif /* LTTNG_TRACE_PRINTK_H */
82 /* This part must be outside protection */
83 #include "../../../probes/define_trace.h"
This page took 0.03009 seconds and 4 git commands to generate.