• Daniel Bristot de Oliveira's avatar
    printk, tracing: Avoiding unneeded blank lines · 78aebca2
    Daniel Bristot de Oliveira authored
    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 <trond.myklebust@primarydata.com>
    Cc: Anna Schumaker <anna.schumaker@netapp.com>
    Cc: Ingo Molnar <mingo@redhat.com>
    Reviewed-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@redhat.com>
    Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
    78aebca2
Name
Last commit
Last update
..
9p.h Loading commit data...
asoc.h Loading commit data...
bcache.h Loading commit data...
block.h Loading commit data...
btrfs.h Loading commit data...
clk.h Loading commit data...
cma.h Loading commit data...
compaction.h Loading commit data...
context_tracking.h Loading commit data...
cpuhp.h Loading commit data...
ext4.h Loading commit data...
f2fs.h Loading commit data...
fence.h Loading commit data...
fib.h Loading commit data...
fib6.h Loading commit data...
filelock.h Loading commit data...
filemap.h Loading commit data...
gpio.h Loading commit data...
host1x.h Loading commit data...
hswadsp.h Loading commit data...
huge_memory.h Loading commit data...
i2c.h Loading commit data...
intel-sst.h Loading commit data...
iommu.h Loading commit data...
ipi.h Loading commit data...
irq.h Loading commit data...
jbd2.h Loading commit data...
kmem.h Loading commit data...
kvm.h Loading commit data...
libata.h Loading commit data...
lock.h Loading commit data...
mce.h Loading commit data...
migrate.h Loading commit data...
mmc.h Loading commit data...
mmflags.h Loading commit data...
module.h Loading commit data...
napi.h Loading commit data...
net.h Loading commit data...
nilfs2.h Loading commit data...
nmi.h Loading commit data...
oom.h Loading commit data...
page_isolation.h Loading commit data...
page_ref.h Loading commit data...
pagemap.h Loading commit data...
power.h Loading commit data...
power_cpu_migrate.h Loading commit data...
printk.h Loading commit data...
random.h Loading commit data...
rcu.h Loading commit data...
regulator.h Loading commit data...
rpm.h Loading commit data...
sched.h Loading commit data...
scsi.h Loading commit data...
signal.h Loading commit data...
skb.h Loading commit data...
sock.h Loading commit data...
spi.h Loading commit data...
spmi.h Loading commit data...
sunrpc.h Loading commit data...
sunvnet.h Loading commit data...
swiotlb.h Loading commit data...
syscalls.h Loading commit data...
target.h Loading commit data...
task.h Loading commit data...
thermal.h Loading commit data...
thermal_power_allocator.h Loading commit data...
thp.h Loading commit data...
timer.h Loading commit data...
tlb.h Loading commit data...
udp.h Loading commit data...
v4l2.h Loading commit data...
vb2.h Loading commit data...
vmscan.h Loading commit data...
workqueue.h Loading commit data...
writeback.h Loading commit data...
xen.h Loading commit data...