public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tommi Rantala <tommi.t.rantala@nokia.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: perf trace --no-syscalls -e rcu:* -- garbage in output
Date: Tue, 26 Jun 2018 15:25:41 +0300	[thread overview]
Message-ID: <a67d93f2-ea36-b399-0843-8cd8fc190bfd@nokia.com> (raw)

Hi,

There some garbage in perf trace output, when tracing some rcu 
tracepoints (kernel is configured with CONFIG_RCU_TRACE=y).

For example in rcu:rcu_callback, instead of getting proper rcuname in 
the first "%s" here, there's garbage:

$ tail -1 /sys/kernel/debug/tracing/events/rcu/rcu_callback/format
print fmt: "%s rhp=%p func=%pf %ld/%ld", REC->rcuname, REC->rhp, 
REC->func, REC->qlen_lazy, REC->qlen

$ ./perf trace --no-syscalls -e 'rcu:*' -- sleep 1 2>&1 | od -t c

0000000                       0   .   0   0   0       r   c   u   :   r
0000020   c   u   _   c   a   l   l   b   a   c   k   : 200 351 345 215
0000040 377 377 377 377       r   h   p   =   0   x   f   f   f   f   8
0000060   d   5   5   8   f   5   b   0   1   0   0       f   u   n   c
0000100   =   f   i   l   e   _   f   r   e   e   _   r   c   u       0
0000120   /   1  \n                       0   .   0   0   8       r   c
0000140   u   :   r   c   u   _   d   y   n   t   i   c   k   : 373 217
0000160 276 215 377 377 377 377       4   0   0   0   0   0   0   0   0
0000200   0   0   0   0   0   0   0       4   0   0   0   0   0   0   0
0000220   0   0   0   0   0   0   0   2       0   x   1   d   2  \n
0000240                   0   .   0   2   3       r   c   u   :   r   c
0000260   u   _   d   y   n   t   i   c   k   : 023 220 276 215 377 377
0000300 377 377       4   0   0   0   0   0   0   0   0   0   0   0   0
0000320   0   0   2       4   0   0   0   0   0   0   0   0   0   0   0
0000340   0   0   0   0       0   x   1   d   2  \n
0000360   0   .   0   2   8       r   c   u   :   r   c   u   _   d   y
0000400   n   t   i   c   k   : 373 217 276 215 377 377 377 377       4
0000420   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0
0000440   4   0   0   0   0   0   0   0   0   0   0   0   0   0   0   2
0000460       0   x   1   d   2  \n                       0   .   0   3
[...]


If I got it right, "pevent" in print_str_arg() is zero-initialized 
(pevent->long_size is zero...), causing "%s" format to produce garbage 
bytes instead of the proper string.

-Tommi

                 reply	other threads:[~2018-06-26 12:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=a67d93f2-ea36-b399-0843-8cd8fc190bfd@nokia.com \
    --to=tommi.t.rantala@nokia.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.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