lkml.org 
[lkml]   [2018]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: printk feature for syzbot?
On (05/10/18 23:50), Tetsuo Handa wrote:
> What I meant is nothing but something like below (i.e. inject context ID before
> string to print)
>
> -sprintf(printk_buf + offset, "[ %s] %s", stamp, string_to_print);
> +cpu = smp_processor_id()
> +if (in_nmi())
> + sprintf(printk_buf + offset, "[ %s](N%u) %s", stamp, cpu, string_to_print);
> +else if (in_irq())
> + sprintf(printk_buf + offset, "[ %s](I%u) %s", stamp, cpu, string_to_print);
> +else if (in_serving_softirq())
> + sprintf(printk_buf + offset, "[ %s](S%u) %s", stamp, cpu, string_to_print);
> +else
> + sprintf(printk_buf + offset, "[ %s](%u) %s", stamp, current->pid, string_to_print);
>
> without touching any struct.

So you basically want to have one more con_msg_format_flags? Do
you want to track a context which prints out a messages or the
context which "generated" the message? A CPU/task that stores
a logbuf entry - vprintk_emit() - is not always the same as the
CPU/task that prints it to consoles - console_unlock().

-ss

\
 
 \ /
  Last update: 2018-05-11 03:46    [W:0.169 / U:3.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site