Re: printk: Add process name information to printk() output.

From: Petr Mladek
Date: Mon Sep 07 2020 - 11:49:51 EST


On Mon 2020-09-07 12:36:45, John Ogness wrote:
> On 2020-09-07, Petr Mladek <pmladek@xxxxxxxx> wrote:
> > This extra metadata are not currently read by crashdump tools.
>
> crash [0] prints dictionary data.
> [0] https://github.com/crash-utility/crash

Grr, I have missed this. It makes things more complicated.

We need to find a way that would allow to add more metadata without
breaking support for the existing ones.

I know, it works with the current dictionary. "crash" just prints it
the same way as "cat /dev/kmsg". Dict entries are printed on separate
lines. It is better than nothing. But it is not much user friendly.

If we add more metadata, people would want to see it some more
userfriendly way, e.g.:

[2020-08-20T07:58:48][ T136] random: crng init done

instead of

[ 1.394073] random: crng init done
PID = 136
CPU = 3
IRQ_CONTEXT = 0;
TS_MONO = 234632423
TS_REAL = 1599211091487260162
[...]

For this, "crash" would need to understand the different variables
stored in dictionary. So, it would become harder to change
the format as well.


Anyway, "crash" could get the information about struct printk_ext_info
via VMCOREINFO_STRUCT_SIZE(), VMCOREINFO_OFFSET() macros.
We could extend the structure if we do not change the format
of the existing items.

I am not 100% sure that the array of struct printk_ext_info is the
best solution. But I still somehow like it more than dict ring. IMHO,
it is more reliable and much easier to work with on the kernel side.

Best Regards,
Petr