[systemd-devel] [RFC PATCH] logs-show: print multiline messages
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Sun Jun 9 10:53:43 PDT 2013
Hi,
On Mon, May 06, 2013 at 11:43:38AM +0200, Lennart Poettering wrote:
> On Fri, 03.05.13 19:55, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> > On Fri, May 03, 2013 at 06:51:35PM +0200, Lennart Poettering wrote:
> > > On Wed, 24.04.13 10:30, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
> > >
> > > > [ 0.019862] fedora kernel: CPU0: Thermal monitoring enabled (TM1)
> > > > [ 0.019900] fedora kernel: Last level iTLB entries: 4KB 512, 2MB 0, 4MB 0
> > > > Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32
> > > > tlb_flushall_shift: 5
> > > > [ 0.020118] fedora kernel: Freeing SMP alternatives: 24k freed
> > > > ---
> > > > A beginning of support for multiline messages. Is this the right approach?
> > > >
> > > > (Not all formats are updated).
Now I've extended both short (shown above), short-monotonic:
[ 0.005553] spora kernel: CPU0: Thermal monitoring enabled (TM1)
[ 0.005562] spora kernel: Last level iTLB entries: 4KB 128, 2MB 4, 4MB 4
Last level dTLB entries: 4KB 256, 2MB 0, 4MB 32
tlb_flushall_shift: -1
and export:
Sat 2013-06-08 16:34:26 EDT [s=8f95e14e3f504a8aac0934dca4466846;i=bdf6;b=724620487b7f4e5aa93cfca3ff9faf80;m=586dbb;t=4deaa793e9afb;x=500ecba09a48651f]
PRIORITY=6
_BOOT_ID=724620487b7f4e5aa93cfca3ff9faf80
_MACHINE_ID=89b36a6f836cb8a001f613bd00000019
_HOSTNAME=spora
_TRANSPORT=kernel
SYSLOG_IDENTIFIER=kernel
_SOURCE_MONOTONIC_TIMESTAMP=5562
MESSAGE=Last level iTLB entries: 4KB 128, 2MB 4, 4MB 4
Last level dTLB entries: 4KB 256, 2MB 0, 4MB 32
tlb_flushall_shift: -1
For comparison, cat still looks like this:
CPU0: Thermal monitoring enabled (TM1)
Last level iTLB entries: 4KB 128, 2MB 4, 4MB 4
Last level dTLB entries: 4KB 256, 2MB 0, 4MB 32
tlb_flushall_shift: -1
I'm pushing this, not because I'm convinced it'll work in all cases,
but because we're far from a release and if this breaks workflows or
tools, there'll be time to fix things.
> > > Hmm, maybe a simpler approach regarding the expansion of \n would be to
> > > extend strip_tab_ansi() to take an additional string param for what to
> > > expand \n to? I think that would be a much simpler patch, no?
> > We want to align fields, so it is necessary to split them on '\n'.
> > Otherwise it'd look like
> >
> > [ 0.019862] fedora kernel: CPU0: Thermal monitoring enabled (TM1)
> > [ 0.019900] fedora kernel: Last level iTLB entries: 4KB 512, 2MB 0, 4MB 0
> > Last level dTLB entries: 4KB 512, 2MB 32, 4MB 32
> > tlb_flushall_shift: 5
> > [ 0.020118] fedora kernel: Freeing SMP alternatives: 24k freed
> >
> > which is definitely not pretty.
>
> Well, that's why I suggested to add a second param that specifies what
> \n shall be expanded to. In your example above you'd hence say that \n
> should be expanded to "\n " and you should
> be good?
Not really, because the lines can also be ellipsized.
The patch is only 83 insertions(+), 58 deletions(-), so I think the current
approach is good enough.
Zbyszek
More information about the systemd-devel
mailing list