diff options
author | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-10-20 00:10:27 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@parabola.nu> | 2016-10-20 00:10:27 -0300 |
commit | d0b2f91bede3bd5e3d24dd6803e56eee959c1797 (patch) | |
tree | 7fee4ab0509879c373c4f2cbd5b8a5be5b4041ee /include/trace/events/printk.h | |
parent | e914f8eb445e8f74b00303c19c2ffceaedd16a05 (diff) |
Linux-libre 4.8.2-gnupck-4.8.2-gnu
Diffstat (limited to 'include/trace/events/printk.h')
-rw-r--r-- | include/trace/events/printk.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/trace/events/printk.h b/include/trace/events/printk.h index c008bc99f..f35017005 100644 --- a/include/trace/events/printk.h +++ b/include/trace/events/printk.h @@ -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)) |