lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181204152724.ypk44mi4a56nrud4@pathway.suse.cz>
Date:   Tue, 4 Dec 2018 16:27:24 +0100
From:   Petr Mladek <pmladek@...e.com>
To:     Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Cc:     Dmitry Vyukov <dvyukov@...gle.com>,
        Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Steven Rostedt <rostedt@...dmis.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] printk: Add caller information to printk() output.

On Tue 2018-12-04 06:10:40, Tetsuo Handa wrote:
> On 2018/12/04 0:06, Petr Mladek wrote:
> >> If we modify print_time(), I think that the leading spaces inserted by "%5lu"
> >> makes little sense, for "%5lu" is too small for systems with uptime >= 1.16 days
> >> and parsers after all cannot assume fixed length for the timestamp field. Then,
> >> we could change from "%5lu.%06lu" to "%lu.%06lu" so that parsers (like /bin/awk)
> >> can get prefix part using white spaces as a delimiter.
> > 
> > My primary concern was a human readability. The different header columns
> > are separated by brackets and the message itself is separated by the space.
> 
> PID_MAX_LIMIT is 4194304, which can take up to 10 bytes if [T%u] is used.

4194304 is the worst case. I would use the same approach as with the
timestamp seconds. It uses 5 characters as the minimum. But it might
eventully get bigger.

IMHO, [T%5u] looks like a reasonable default.


> But unless a race occurs, each series of printk() lines are printed with
> same width.

It is not about series of printk() lines. It is about readability of the
entire log.


> My concern is how to minimize number of characters written to
> consoles, for writing to consoles are slow, and userspace usually uses
> /dev/kmsg rather than netconsole as a source. For normal users who do not
> need to directly parse console/netconsole output, saving spaces in the header
> fields will be OK.

The number of characters is important. But we do not need to get to the
extreme. Readability by humans is important.


> > /dev/kmsg uses key=value notation. It does not need any version. The
> > version filed was intended for crashdump. It would make the life
> > easier for its maintainers.
> 
> If the version field is for crashdump rather than for netconsole, we can
> get it from some vmcoreinfo variable rather than appending to every record.

Exactly. And I asked you to add back
VMCOREINFO_OFFSET(printk_log, from_id).

Best Regards,
Petr

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ