netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHSET] printk: implement extended console support
@ 2015-04-29 14:45 Tejun Heo
  2015-04-29 14:45 ` [PATCH 1/3] printk: guard the amount written per line by devkmsg_read() Tejun Heo
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Tejun Heo @ 2015-04-29 14:45 UTC (permalink / raw)
  To: pmladek, akpm; +Cc: davem, linux-kernel, netdev

This patchset is v2 of printk extended console support.  v1 was part
of "printk, netconsole: implement reliable netconsole" patchset [1].
The biggest change is dropping of cont buffer handling as hinted by
Petr's hint.  This made it unnecessary to change LOG_NOCONS handling
and made the actual extended console support a lot simpler as now each
printk invocation always maps to a single log entry.

The kernel keeps quite a bit of metadata for each printk message in
its log buffer, all of which are accessible through /dev/kmsg;
however, when the messages are transmitted to consoles, a lot of
metadata is lost along with dictionary for structured logging.

Allowing consoles access to full log message information can be useful
for multiple reasons.  The consumer of the console output can identify
the orginating facility, make use of structured logging, determine
whether any message got lost if the medium isn't reliable and so on.
This will be further discussed in the netconsole patchset which will
follow soon.

Thanks to /dev/kmsg, printk already implements most of logic necessary
for extended console support.  The header is well defined and the
formatting code is already there.  The only possible complication is
handling of cont buffer.

This is dealt with by simply disabling in-kernel KERN_CONT
concatenation when extended consoles are registered.  This makes
message fragments consume more memory as each gets assigned a separate
log entry, but this greatly simplifies extended console support and
provided that /dev/kmsg and extended consumers perform trivial
concatenation directed by the <contflag> field, the end results are
the same.  In the long term, we might want to drop in-kernel
concatenation entirely.

Note that currently neither dmesg nor journald implements <contflag>
handling but this is trivial to add and this patchset doesn't change
the kernel behavior when no external console is registered.

This patchset contains the following three patches.

0001-printk-guard-the-amount-written-per-line-by-devkmsg_.patch
0002-printk-factor-out-message-formatting-from-devkmsg_re.patch
0003-printk-implement-support-for-extended-console-driver.patch

0001-0002 are straight-forward prep patches.  0003 implements the
extended console support.

The patches are also available in the following git branch.

 git://git.kernel.org/pub/scm/linux/kernel/git/tj/misc.git review-printk-ext-console

diffstat follows.  Thanks.

 include/linux/console.h |    1
 include/linux/printk.h  |    2
 kernel/printk/printk.c  |  213 ++++++++++++++++++++++++++++++++----------------
 3 files changed, 146 insertions(+), 70 deletions(-)

--
tejun

[1] http://lkml.kernel.org/g/1429225433-11946-1-git-send-email-tj@kernel.org

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2015-07-03 16:22 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-29 14:45 [PATCHSET] printk: implement extended console support Tejun Heo
2015-04-29 14:45 ` [PATCH 1/3] printk: guard the amount written per line by devkmsg_read() Tejun Heo
2015-04-29 14:45 ` [PATCH 2/3] printk: factor out message formatting from devkmsg_read() Tejun Heo
2015-04-29 14:45 ` [PATCH 3/3] printk: implement support for extended console drivers Tejun Heo
2015-04-30 21:31   ` Andrew Morton
2015-04-30 22:12     ` Tejun Heo
2015-04-30 22:15       ` Andrew Morton
2015-05-01 16:23   ` [PATCH v3 " Tejun Heo
2015-06-29  9:20   ` [PATCH " Geert Uytterhoeven
2015-06-29 15:28     ` Tejun Heo
2015-06-29 15:47       ` Geert Uytterhoeven
2015-06-29 15:49         ` Tejun Heo
2015-06-29 16:11           ` josh
2015-06-29 16:11           ` Geert Uytterhoeven
2015-06-29 16:13             ` Tejun Heo
2015-06-29 16:50               ` josh
2015-06-29 23:31               ` [PATCH v4.2-rc1] printk: make extended printk support conditional on netconsole Tejun Heo
2015-07-01 16:05                 ` Petr Mladek
2015-07-02 16:21                 ` [PATCH v2 " Tejun Heo
2015-07-03 14:07                   ` Petr Mladek
2015-07-03 15:25                     ` Tejun Heo
2015-07-03 16:22                   ` [PATCH v3 " Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).