lkml.org 
[lkml]   [2017]   [Aug]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: printk: what is going on with additional newlines?
    On (08/29/17 19:31), Joe Perches wrote:
    [..]
    > > the idea is not to do printk() on that seq buffer at all, but to
    > > log_store(), atomically, seq buffer messages
    > >
    > > spin_lock(&logbuf_lock)
    > > while (offset < seq_buffer->len) {
    > > ...
    > > log_store(seq->buffer + offset);
    > > ...
    > > }
    > > spin_unlock(&logbuf_unlock)
    >
    > Why?
    >
    > What's wrong with a simple printk?
    > It'd still do a log_store.

    sure, it will. but in separate logbuf entries, and between two
    consequent printk calls on the same CPU a lot of stuff can happen:
    IRQs->printks, rescheduling->printks, etc. etc. (not to mention
    concurrent printks from other CPUs) so what people want to have is
    to have a way to make several printks appear next to each other in
    the logs (dmesg or serial log). Tetsuo wants this, for instance,
    for OOM reports and backtraces. SCIS/ATA people want it as well.

    -ss

    \
     
     \ /
      Last update: 2017-08-30 04:44    [W:2.362 / U:0.044 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site