Commit Graph
4 Commits
Author SHA1 Message Date
Daniel Bristot de Oliveira 78aebca2c9 printk, tracing: Avoiding unneeded blank lines
Printk messages often finish with '\n' to cause a new line.
But as each tracepoint is already printed in a new line,
printk messages that finish with '\n' ends up adding a blank
line to the trace output. For example:

     kworker/0:1-86    [000] d...    46.006949: console: [   46.006946] usb 1-3: USB disconnect, device number 3

     kworker/2:2-374   [002] d...    48.699342: console: [   48.699339] usb 1-3: new high-speed USB device number 4 using ehci-pci

     kworker/2:2-374   [002] d...    49.041450: console: [   49.041448] usb 1-3: New USB device found, idVendor=5986, idProduct=0

To avoid unneeded blank lines, this patch checks if the printk
message finishes with '\n', if so, it cut is off the '\n' to
avoid blank lines.

In a patched kernel, the same messages are printed without
extra blank lines. For example:

     kworker/0:4-185   [000] d...    23.641738: console: [   23.641736] usb 1-3: USB disconnect, device number 3
     kworker/0:4-185   [000] d...    24.918703: console: [   24.918700] usb 1-3: new high-speed USB device number 4 using ehci-pci
     kworker/0:4-185   [000] d...    25.228308: console: [   25.228306] usb 1-3: New USB device found, idVendor=5986, idProduct=02d5

Link: http://lkml.kernel.org/r/c350fb2521baaf681a1b4d67981ca0e900108e8e.1467407618.git.bristot@redhat.com

Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Reviewed-by: Steven Rostedt <[email protected]>
Signed-off-by: Daniel Bristot de Oliveira <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
2016-07-15 15:52:41 -04:00
Daniel Bristot de Oliveira 752d596b39 tracing: Use __get_str() when manipulating strings
Use __get_str(str) rather than __get_dynamic_array(str) when
deadling with strings.

It is just a code cleanup, no changes on tracepoint ABI.

Link: http://lkml.kernel.org/r/ea260df91817411cca2a1f3db2abd88860094788.1467407618.git.bristot@redhat.com

Cc: Trond Myklebust <[email protected]>
Cc: Anna Schumaker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: [email protected]
Suggested-by: Steven Rostedt <[email protected]>
Reviewed-by: Steven Rostedt <[email protected]>
Signed-off-by: Daniel Bristot de Oliveira <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
2016-07-15 15:52:20 -04:00
zhangwei(Jovi) 07c65f4d1a printk/tracing: rework console tracing
Commit 7ff9554bb5 ("printk: convert byte-buffer to variable-length
record buffer") removed start and end parameters from
call_console_drivers, but those parameters still exist in
include/trace/events/printk.h.

Without start and end parameters handling, printk tracing became more
simple as: trace_console(text, len);

Signed-off-by: zhangwei(Jovi) <[email protected]>
Acked-by: Steven Rostedt <[email protected]>
Acked-by: Frederic Weisbecker <[email protected]>
Cc: Kay Sievers <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
2013-04-29 18:28:13 -07:00
Johannes Berg 9510035849 printk/tracing: Add console output tracing
Add a printk.console trace point to record any printk
messages into the trace, regardless of the current
console loglevel. This can help correlate (existing)
printk debugging with other tracing.

Link: http://lkml.kernel.org/r/[email protected]

Acked-by: Frederic Weisbecker <[email protected]>
Cc: Christoph Hellwig <[email protected]>
Cc: Ingo Molnar <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Acked-by: Thomas Gleixner <[email protected]>
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: Steven Rostedt <[email protected]>
2012-02-13 13:46:05 -05:00