Merge tag 'drm-intel-next-fixes-2016-08-05' of git://anongit.freedesktop.org/drm...
[deliverable/linux.git] / include / trace / events / printk.h
index c008bc99f9fa9093beb2668f2ebb33a72b825715..f350170059c6c274dc951fb7b550272c8bff4df9 100644 (file)
@@ -16,8 +16,16 @@ TRACE_EVENT(console,
        ),
 
        TP_fast_assign(
-               memcpy(__get_dynamic_array(msg), text, len);
-               ((char *)__get_dynamic_array(msg))[len] = 0;
+               /*
+                * Each trace entry is printed in a new line.
+                * If the msg finishes with '\n', cut it off
+                * to avoid blank lines in the trace.
+                */
+               if ((len > 0) && (text[len-1] == '\n'))
+                       len -= 1;
+
+               memcpy(__get_str(msg), text, len);
+               __get_str(msg)[len] = 0;
        ),
 
        TP_printk("%s", __get_str(msg))
This page took 0.044336 seconds and 5 git commands to generate.