Skip to contentSkip to conversation

Update prink:console tracepoint for 3.10 kernel

PATCH Mathieu Desnoyers 1 participant 1 message Jun 28, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 18 lines · * Yannick Brosseau ([email protected]) wrote:
---
 instrumentation/events/lttng-module/printk.h |   26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
instrumentation/events/lttng-module/printk.h +5 -0
index 4c744f9..16f5716 100644
@@ -9,6 +9,31 @@
 
 #define MSG_TRACE_MAX_LEN	2048
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0))
+TRACE_EVENT(console,
+        TP_PROTO(const char *text, size_t len),
+
+        TP_ARGS(text, len),

instrumentation/events/lttng-module/printk.h line 26

Quoted 10 lines
instrumentation/events/lttng-module/printk.h +10 -0
+
+        TP_STRUCT__entry(
+                __dynamic_array_text(char, msg, min_t(unsigned, len, MSG_TRACE_MAX_LEN))
+        ),
+
+        TP_fast_assign(
+                tp_memcpy_dyn(msg,
+                        ({
+                                char lmsg[MSG_TRACE_MAX_LEN + 1];
+				unsigned start = 0;

tab alignment issues ?

Thanks,

Mathieu

Quoted 29 lines
instrumentation/events/lttng-module/printk.h +11 -0
+                                if (len > MSG_TRACE_MAX_LEN) {
+                                        start = len - MSG_TRACE_MAX_LEN;
+					len = MSG_TRACE_MAX_LEN;
+				}
+                                memcpy(lmsg, text + start, len);
+                                lmsg[len] = 0;
+                                lmsg;
+                        })
+                )
+#else
 TRACE_EVENT_CONDITION(console,
 	TP_PROTO(const char *log_buf, unsigned start, unsigned end,
 		 unsigned log_buf_len),
@@ -54,6 +79,7 @@ TRACE_EVENT_CONDITION(console,
 				lmsg;
 			})
 		)
+#endif
 	),
 
 	TP_printk("%s", __get_str(msg))
Signature · 7 lines
1.7.10.4


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
Signature · 3 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com