public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Breno Leitao <leitao@debian.org>
Cc: John Ogness <john.ogness@linutronix.de>,
	osandov@osandov.com, mpdesouza@suse.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, asantostc@gmail.com, efault@gmx.de,
	gustavold@gmail.com, calvin@wbinvd.org, jv@jvosburgh.net,
	kernel-team@meta.com, Simon Horman <horms@kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	rostedt@goodmis.org
Subject: Re: [PATCH net-next 0/2] net: netconsole: convert to NBCON console infrastructure
Date: Mon, 19 Jan 2026 15:00:11 +0100	[thread overview]
Message-ID: <aW446yxd-FQ1JJ9Q@pathway.suse.cz> (raw)
In-Reply-To: <6tryrckp7mah2qghxu5fktrwexoik6anplubfvybushtcgocq5@kg6ln44istyk>

On Fri 2026-01-16 10:07:08, Breno Leitao wrote:
> Hello Petr,
> 
> On Fri, Jan 16, 2026 at 04:53:48PM +0100, Petr Mladek wrote:
> > > Otherwise, it looks good to me.
> > > 
> > > I tried to update your patch with the above proposal to see how
> > > it looks and I got:
> > 
> > The change seems to work. I have tested it with the following patch:
> 
> First of all, *thank you* so much for spending your time on it, this is
> helpful.

You are welcome.

> > Then the extended console format should show also:
> > 
> >      ,cpu=XXX,pid=YYY,comm=ZZZ
> 
> Are you using this just for testing, or do you plan to get this output?

I used this just for testing. But it looks like a good variant for me.

Note that the above is /dev/kmsg output. It would show dev_printk()
messages the following way:

6,295,1164587,-,caller=T1,cpu=10,pid=1,comm=swapper/0;pci 0000:00:02.1: enabling Extended Tags
 SUBSYSTEM=pci
 DEVICE=+pci:0000:00:02.1
6,296,1167287,-,caller=T1,cpu=10,pid=1,comm=swapper/0;pci 0000:00:02.2: [1b36:000c] type 01 class 0x060400 PCIe Root Port
 SUBSYSTEM=pci
 DEVICE=+pci:0000:00:02.2


We would need to use another format for (slow) consoles, for example:

     <level>[timestamp][Cxxx][context]comm[pid] message

, where:

   + [Cxxx] would show cpu number like the current context field, e.g [  C123]

   + [context] would show context, ideal in some existing format. But
     I know only about lockdep format which looks a bit hard to
     understand for me.

     For example, it might be, for example [TC,HD] for a task context
     with hard irqs disabled.


   + comm[pid] is inspired by the existing messages passed from systemd, e.g.
     <30>[    5.317305][    T1] systemd[1]: Starting Journal Service...
     <30>[    5.349000][    T1] systemd[1]: Starting Load Kernel Modules...

But I guess that this might be long bikesheding about this.

> Context: netconsole outputs the message in a different way, similarly to the
> printk dictionary. I.e, taskname and cpu come after, one entry per line:
> 
>   <message>
>    SUBSYSTEM=net
>    DEVICE=+pci:0000:00:1f.6
>    cpu=42
>    taskname=NetworkManager
>    ...

I see. Honestly, I never liked the way how dictionary was printed.
It used another syntax than loglevel, sequence id, and timestamp.
It might be confusing and complicate parsing.

But it is a personal opinion. Others might like it because
it might be easier for human eyes parsing.

IMHO, the information needs some parsing anyway to make it human readable:

  + people do not know the log level meaning out of head
  + message id is there primary to detect lost messages
  + timestamp needs conversion, definitely

Sigh, the use of lower case letters for "cpu" and "taskname" made it
even more inconsistent. I would voted against it if I did the review ;-)

> I would like to keep the same format, given users might be used to this format
> already, where netconsole grabs teh cpu,pid,comm data and massage it before
> outputing. Something as:
> 
>  static int sysdata_append_taskname(struct netconsole_target *nt, int offset,
> 				    struct nbcon_write_context *wctxt)
>  {
>      return scnprintf(&nt->sysdata[offset],
>               MAX_EXTRADATA_ENTRY_LEN, " taskname=%s\n",
> -             current->comm);
> +             wctxt->msg_comm);
>  }

I see. I think that you could keep it for now. It might take quite
some time until we integrate this for /dev/kmsg, ...

> Here is the full patch I was using to test the integration of netconsole and
> the previous printk patch:
> 
> https://github.com/leitao/linux/commit/4175dc10719a15844b3a0bd7aa38158a913181a3

BTW.1: I see that netconsole actually does not show pid. So that we do not
       need the trick with caller_id2. But people might want to add it in
       the future.

       I do not have strong opinion about it. We could change it
       anytime later if we did not export the new fields for crash
       dump, via the VMCOREINFO_OFFSET() macro.


BTW.2: I also noticed that sysdata_append_msgid() uses netconsole-specific
       message counter.

       Note that each message has its own sequence number. It is the
       .seq member in struct printk_info. It is printed in the extended
       console output, see info_print_ext_header(). So it is printed
       even on netconsole when this extended format is used.

       I wonder if the netconsole-specific counter was added
       intentionally.


Best Regards,
Petr

  reply	other threads:[~2026-01-19 14:00 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 14:52 [PATCH net-next 0/2] net: netconsole: convert to NBCON console infrastructure Breno Leitao
2025-12-22 14:52 ` [PATCH net-next 1/2] netconsole: extract message fragmentation into send_msg_udp() Breno Leitao
2025-12-22 14:52 ` [PATCH net-next 2/2] netconsole: convert to NBCON console infrastructure Breno Leitao
2026-01-02  3:54   ` Marcos Paulo de Souza
2026-01-06 15:43     ` Breno Leitao
2026-01-07 15:04       ` Marcos Paulo de Souza
2025-12-23  7:12 ` [PATCH net-next 0/2] net: " Paolo Abeni
2025-12-23  9:44   ` Breno Leitao
2026-01-07 14:49 ` Breno Leitao
2026-01-07 15:50   ` John Ogness
2026-01-07 16:58     ` Breno Leitao
2026-01-08 11:08       ` Breno Leitao
2026-01-08 16:50         ` John Ogness
2026-01-09 10:48           ` Breno Leitao
2026-01-09 13:29           ` Petr Mladek
2026-01-09 14:03             ` Petr Mladek
2026-01-09 15:13             ` John Ogness
2026-01-12 10:55               ` Breno Leitao
2026-01-12 12:44                 ` Breno Leitao
2026-01-16 15:51                   ` Petr Mladek
2026-01-16 15:53                     ` Petr Mladek
2026-01-16 18:07                       ` Breno Leitao
2026-01-19 14:00                         ` Petr Mladek [this message]
2026-01-19 16:34                           ` Breno Leitao
2026-01-20  8:59                             ` Petr Mladek
2026-01-20  9:17                               ` Breno Leitao
2026-01-20 10:10                               ` John Ogness
2026-01-12 14:17               ` Petr Mladek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aW446yxd-FQ1JJ9Q@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=asantostc@gmail.com \
    --cc=calvin@wbinvd.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=efault@gmx.de \
    --cc=gustavold@gmail.com \
    --cc=horms@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=jv@jvosburgh.net \
    --cc=kernel-team@meta.com \
    --cc=kuba@kernel.org \
    --cc=leitao@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpdesouza@suse.com \
    --cc=netdev@vger.kernel.org \
    --cc=osandov@osandov.com \
    --cc=pabeni@redhat.com \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox