public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* perf trace --no-syscalls -e rcu:* -- garbage in output
@ 2018-06-26 12:25 Tommi Rantala
  0 siblings, 0 replies; only message in thread
From: Tommi Rantala @ 2018-06-26 12:25 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Alexander Shishkin, Jiri Olsa, Namhyung Kim
  Cc: linux-kernel

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-06-26 12:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-26 12:25 perf trace --no-syscalls -e rcu:* -- garbage in output Tommi Rantala

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox