Re: [PATCH printk v2 3/4] printk: Skip unfinalized records in panic

From: John Ogness
Date: Mon Oct 23 2023 - 05:54:09 EST


On 2023-10-18, Petr Mladek <pmladek@xxxxxxxx> wrote:
> I think about "empty line record" and "records with missing data".
> And I would rename NO_LPOS to EMPTY_LINE_LPOS to make the meaning
> more obvious.

OK.

> Also it would make sense to use 0x2 for EMPTY_LINE_LPOS and
>
> #define FAILED_LPOS 0x1
> #define EMPTY_LINE_LPOS 0x2
> #define DATALESS_LPOS_MASK (FAILED_LPOS | EMPTY_LINE_LPOS)
>
> #define LPOS_DATALESS(lpos) ((lpos) & DATALESS_LPOS_MASK)

The existing debugging tools use bit0 to identify if there is data. Bit1
is really the _reason_ for the missing data. This can be seen in the
definition of LPOS_DATALESS(), but it needs to be documented
better. (Ideally where FAILED_LPOS and EMPTY_LINE_LPOS are defined.)

John