mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Enlin Mu <enlinmu@gmail.com>
Cc: Yunlong Xing <yunlong.xing@unisoc.com>,
	senozhatsky@chromium.org, rostedt@goodmis.org,
	john.ogness@linutronix.de, linux-kernel@vger.kernel.org,
	enlin.mu@unisoc.com, yunlong.xing23@gmail.com
Subject: Re: [PATCH] printk: export symbols for debug modules
Date: Wed, 16 Aug 2023 11:31:32 +0200	[thread overview]
Message-ID: <ZNyXdDlruiQAQeMl@alley> (raw)
In-Reply-To: <CAAfh-jM0B2Cn579B0CkCrW44pJGGvjs112K+oMuViib+jDKafg@mail.gmail.com>

On Wed 2023-08-16 09:24:29, Enlin Mu wrote:
> Petr Mladek <pmladek@suse.com> 于2023年8月15日周二 21:55写道:
> >
> > On Tue 2023-08-15 10:07:11, Yunlong Xing wrote:
> > > From: Enlin Mu <enlin.mu@unisoc.com>
> > >
> > > the module is out-of-tree, it saves kernel logs when panic
> > >
> > > Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
> >
> > I am fine with it. After all, this API seems to here for
> > similar purposes.
> Thanks.
> >
> > Acked-by: Petr Mladek <pmladek@suse.com>
> >
> > Of course, it would be better to maintain the module in upstream.
> > Is there any chance to get it upstream? It seems that it
> > is GPL-compatible so...
> Yes, currently under development. Once the code debugging is stable,
> it will be pushed to the community.

Great.

One more thing which came to my mind.

The log buffer contains the plain text and "id" of the related
metadata. Namely, there is always an "unsigned long" before
each message, see struct prb_data_block.

You might consider using the kmsg_dump API. It has been added
for this purpose. It allows to read and store the messages
one by one. And the messages are formatted the same way
as on console or by dmesg.

The registered dumpers are automatically called in panic().
See kmsg_dump(KMSG_DUMP_PANIC) in panic().

There are few users of this API. Look for kmsg_dump_register()
to get some inspiration.

Best Regards,
Petr

  reply	other threads:[~2023-08-16  9:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-15  2:07 Yunlong Xing
2023-08-15 13:55 ` Petr Mladek
2023-08-15 15:04   ` Sergey Senozhatsky
2023-08-16  1:24   ` Enlin Mu
2023-08-16  9:31     ` Petr Mladek [this message]
2023-08-17  4:14       ` Enlin Mu
2023-08-28  7:18 ` Christoph Hellwig

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=ZNyXdDlruiQAQeMl@alley \
    --to=pmladek@suse.com \
    --cc=enlin.mu@unisoc.com \
    --cc=enlinmu@gmail.com \
    --cc=john.ogness@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=yunlong.xing23@gmail.com \
    --cc=yunlong.xing@unisoc.com \
    /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

all inboxes | Powered by JetHome®