X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=instrumentation%2Fevents%2Flttng-module%2Fprintk.h;h=077fc45c0d614ba2f7ba70f8d0d40c8a4bebe01a;hb=3ec297489acd3eea5bcab22e162fdb3ea640fe08;hp=16949c4d83da54c25cebc73c01fb655c387da558;hpb=3bc29f0a41b3c803245b845db2e1909042e72e9c;p=lttng-modules.git diff --git a/instrumentation/events/lttng-module/printk.h b/instrumentation/events/lttng-module/printk.h index 16949c4d..077fc45c 100644 --- a/instrumentation/events/lttng-module/printk.h +++ b/instrumentation/events/lttng-module/printk.h @@ -4,75 +4,67 @@ #if !defined(LTTNG_TRACE_PRINTK_H) || defined(TRACE_HEADER_MULTI_READ) #define LTTNG_TRACE_PRINTK_H -#include "../../../probes/lttng-tracepoint-event.h" +#include #include #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0)) -LTTNG_TRACEPOINT_EVENT(console, - TP_PROTO(const char *text, size_t len), +LTTNG_TRACEPOINT_EVENT_MAP(console, - TP_ARGS(text, len), + printk_console, - TP_STRUCT__entry( - __dynamic_array_text(char, msg, len) - ), + TP_PROTO(const char *text, size_t len), - TP_fast_assign( - tp_memcpy_dyn(msg, text) - ), + TP_ARGS(text, len), - TP_printk("%s", __get_str(msg)) + TP_FIELDS( + ctf_sequence_text(char, msg, text, size_t, len) + ) ) #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0)) -LTTNG_TRACEPOINT_EVENT_CONDITION(console, +LTTNG_TRACEPOINT_EVENT_MAP(console, + + printk_console, + TP_PROTO(const char *log_buf, unsigned start, unsigned end, unsigned log_buf_len), TP_ARGS(log_buf, start, end, log_buf_len), - TP_CONDITION(start != end), - - TP_STRUCT__entry( - __dynamic_array_text(char, msg, end - start) - ), - - TP_fast_assign( - tp_memcpy_dyn(msg, log_buf + start) - ), - - TP_printk("%s", __get_str(msg)) + TP_FIELDS( + ctf_sequence_text(char, msg, log_buf + start, + size_t, end - start) + ) ) #else /* (LINUX_VERSION_CODE < KERNEL_VERSION(3,5,0)) */ -LTTNG_TRACEPOINT_EVENT_CONDITION(console, +LTTNG_TRACEPOINT_EVENT_MAP(console, + + printk_console, + TP_PROTO(const char *log_buf, unsigned start, unsigned end, unsigned log_buf_len), TP_ARGS(log_buf, start, end, log_buf_len), - TP_CONDITION(start != end), - - TP_STRUCT__entry( - __dynamic_array_text_2(char, msg, - (start & (log_buf_len - 1)) > (end & (log_buf_len - 1)) + TP_FIELDS( + /* + * printk buffer is gathered from two segments on older kernels. + */ + ctf_sequence_text(char, msg1, + log_buf + (start & (log_buf_len - 1)), + size_t, (start & (log_buf_len - 1)) > (end & (log_buf_len - 1)) ? log_buf_len - (start & (log_buf_len - 1)) - : end - start, - (start & (log_buf_len - 1)) > (end & (log_buf_len - 1)) + : end - start) + ctf_sequence_text(char, msg2, + log_buf, + size_t, (start & (log_buf_len - 1)) > (end & (log_buf_len - 1)) ? end & (log_buf_len - 1) : 0) - ), - - TP_fast_assign( - tp_memcpy_dyn_2(msg, - log_buf + (start & (log_buf_len - 1)), - log_buf) - ), - - TP_printk("%s", __get_str(msg)) + ) ) #endif @@ -80,4 +72,4 @@ LTTNG_TRACEPOINT_EVENT_CONDITION(console, #endif /* LTTNG_TRACE_PRINTK_H */ /* This part must be outside protection */ -#include "../../../probes/define_trace.h" +#include