linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Chuck Lever III <chuck.lever@oracle.com>
Cc: John 'Warthog9' Hawley <warthog9@eaglescrag.net>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: possible trace_printk() bug in v5.19-rc1
Date: Mon, 27 Jun 2022 15:01:15 -0400	[thread overview]
Message-ID: <20220627150115.066e17d1@gandalf.local.home> (raw)
In-Reply-To: <25C37F40-7D8E-41C6-961F-0774C8138CCB@oracle.com>

On Mon, 27 Jun 2022 17:19:18 +0000
Chuck Lever III <chuck.lever@oracle.com> wrote:

> > Would you be able to send me a trace.dat file that has this issue?  
> 
> Sending under separate cover.

I found this is the kallsyms output:

ffffffffac820000 b __brk_early_pgt_alloc
ffffffffac830000 B _end
ffffffffac830000 B __brk_limit
ffffffffc0948205 0944410 t qrtr_alloc_ctrl_packet       [qrtr]
ffffffffc0944470 t qrtr_node_enqueue    [qrtr]
ffffffffc094d100 b __key.5      [qrtr]
ffffffffc09448b0 t qrtr_reset_ports     [qrtr]
ffffffffc094c1c0 d qrtr_ports   [qrtr]
ffffffffc094d100 b __key.3      [qrtr]
ffffffffc094d100 b __key.4      [qrtr]

The line with:

  ffffffffc0948205 0944410 t qrtr_alloc_ctrl_packet       [qrtr]

Causes the parsing to stop, because it is not of a proper format. It has
that extra "0944410" in it, which will break the parsing.

Now the question is, why does that exist? And yes, that's a kernel bug.

The kallsyms code that outputs this file is:

static int s_show(struct seq_file *m, void *p)
{
	void *value;
	struct kallsym_iter *iter = m->private;

	/* Some debugging symbols have no name.  Ignore them. */
	if (!iter->name[0])
		return 0;

	value = iter->show_value ? (void *)iter->value : NULL;

	if (iter->module_name[0]) {
		char type;

		/*
		 * Label it "global" if it is exported,
		 * "local" if not exported.
		 */
		type = iter->exported ? toupper(iter->type) :
					tolower(iter->type);
		seq_printf(m, "%px %c %s\t[%s]\n", value,
			   type, iter->name, iter->module_name);
	} else
		seq_printf(m, "%px %c %s\n", value,
			   iter->type, iter->name);
	return 0;
}

So how did it get that strange output.

Hmm, I bet it is because trace-cmd reads it in BUFSIZ blocks, and that the
seq_file code got confused when parsing between two elements, I bet
something got dropped. I'll go see if there was any seq_file updates that
could have caused this.

-- Steve

  reply	other threads:[~2022-06-27 19:01 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 15:22 possible trace_printk() bug in v5.19-rc1 Chuck Lever III
2022-06-16 15:34 ` Steven Rostedt
2022-06-16 15:36   ` Chuck Lever III
2022-06-16 15:43     ` Steven Rostedt
2022-06-16 18:07       ` Chuck Lever III
2022-06-17 19:50     ` Steven Rostedt
2022-06-18  1:28       ` Chuck Lever III
2022-06-20  0:57         ` Chuck Lever III
2022-06-24 18:23           ` Chuck Lever III
2022-06-24 23:08           ` Steven Rostedt
2022-06-25 17:15             ` Chuck Lever III
2022-06-25 17:45               ` Steven Rostedt
2022-06-25 18:28                 ` John 'Warthog9' Hawley
2022-06-26  3:01                   ` John 'Warthog9' Hawley
2022-06-27 17:08                     ` Chuck Lever III
2022-06-27 17:11                       ` Steven Rostedt
2022-06-27 17:19                         ` Chuck Lever III
2022-06-27 19:01                           ` Steven Rostedt [this message]
2022-06-28 15:24                           ` Steven Rostedt
2022-06-25 18:50                 ` Chuck Lever III
2022-06-25 23:01                   ` Steven Rostedt
2022-06-26 17:09                     ` Chuck Lever III
2022-06-27 15:43                       ` Steven Rostedt
2022-06-27 15:51                         ` Chuck Lever III
2022-06-27 16:02                           ` Steven Rostedt
2022-06-28  3:59             ` Steven Rostedt

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=20220627150115.066e17d1@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=warthog9@eaglescrag.net \
    /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;
as well as URLs for NNTP newsgroup(s).