<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/ring_buffer.c, branch mybooklive</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/trace/ring_buffer.c?h=mybooklive</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/trace/ring_buffer.c?h=mybooklive'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2010-04-01T22:58:08Z</updated>
<entry>
<title>ring-buffer: Move disabled check into preempt disable section</title>
<updated>2010-04-01T22:58:08Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2010-03-08T06:50:43Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9dfa691caee866df28691815e708a914349a6f10'/>
<id>urn:sha1:9dfa691caee866df28691815e708a914349a6f10</id>
<content type='text'>
commit 52fbe9cde7fdb5c6fac196d7ebd2d92d05ef3cd4 upstream.

The ring buffer resizing and resetting relies on a schedule RCU
action. The buffers are disabled, a synchronize_sched() is called
and then the resize or reset takes place.

But this only works if the disabling of the buffers are within the
preempt disabled section, otherwise a window exists that the buffers
can be written to while a reset or resize takes place.

Reported-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
LKML-Reference: &lt;4B949E43.2010906@cn.fujitsu.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>ring-buffer: Synchronize resizing buffer with reader lock</title>
<updated>2009-11-04T05:04:20Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-11-03T11:42:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=f7112949f6a4cd6883d66c882d568c2197321de6'/>
<id>urn:sha1:f7112949f6a4cd6883d66c882d568c2197321de6</id>
<content type='text'>
We got a sudden panic when we reduced the size of the
ringbuffer.

We can reproduce the panic by the following steps:

echo 1 &gt; events/sched/enable
cat trace_pipe &gt; /dev/null &amp;

while ((1))
do
echo 12000 &gt; buffer_size_kb
echo 512 &gt; buffer_size_kb
done

(not more than 5 seconds, panic ...)

Reported-by: KOSAKI Motohiro &lt;kosaki.motohiro@jp.fujitsu.com&gt;
Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
LKML-Reference: &lt;4AF01735.9060409@cn.fujitsu.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Remove cpu arg from the rb_time_stamp() function</title>
<updated>2009-10-24T09:07:51Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2009-10-23T23:36:19Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=6d3f1e12f46a2f9a1bb7e7aa433df8dd31ce5647'/>
<id>urn:sha1:6d3f1e12f46a2f9a1bb7e7aa433df8dd31ce5647</id>
<content type='text'>
The cpu argument is not used inside the rb_time_stamp() function.
Plus fix a typo.

Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;20091023233647.118547500@goodmis.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: Fix comment typo and documentation example</title>
<updated>2009-10-24T09:07:50Z</updated>
<author>
<name>Jiri Olsa</name>
<email>jolsa@redhat.com</email>
</author>
<published>2009-10-23T23:36:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=67b394f7f26d84edb7294cc6528ab7ca6daa2ad1'/>
<id>urn:sha1:67b394f7f26d84edb7294cc6528ab7ca6daa2ad1</id>
<content type='text'>
Trivial patch to fix a documentation example and to fix a
comment.

Signed-off-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;20091023233646.871719877@goodmis.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>includecheck fix: kernel/trace, ring_buffer.c</title>
<updated>2009-09-20T11:28:56Z</updated>
<author>
<name>Jaswinder Singh Rajput</name>
<email>jaswinderrajput@gmail.com</email>
</author>
<published>2009-09-20T11:01:16Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a0f320f48799f67329fcb1b26ff0451c304e1dde'/>
<id>urn:sha1:a0f320f48799f67329fcb1b26ff0451c304e1dde</id>
<content type='text'>
fix the following 'make includecheck' warning:

  kernel/trace/ring_buffer.c: trace.h is included more than once.

Signed-off-by: Jaswinder Singh Rajput &lt;jaswinderrajput@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Ingo Molnar &lt;mingo@elte.hu&gt;
Cc: Sam Ravnborg &lt;sam@ravnborg.org&gt;
LKML-Reference: &lt;1247068617.4382.107.camel@ht.satnam&gt;
</content>
</entry>
<entry>
<title>ring-buffer: typecast cmpxchg to fix PowerPC warning</title>
<updated>2009-09-14T13:41:57Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-09-14T13:31:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=08a408161749d2406f94f4e3d47cfdbc826ad1cc'/>
<id>urn:sha1:08a408161749d2406f94f4e3d47cfdbc826ad1cc</id>
<content type='text'>
The cmpxchg used by PowerPC does the following:

  ({									 \
     __typeof__(*(ptr)) _o_ = (o);					 \
     __typeof__(*(ptr)) _n_ = (n);					 \
     (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,		 \
				    (unsigned long)_n_, sizeof(*(ptr))); \
  })

This does a type check of *ptr to both o and n.

Unfortunately, the code in ring-buffer.c assigns longs to pointers
and pointers to longs and causes a warning on PowerPC:

ring_buffer.c: In function 'rb_head_page_set':
ring_buffer.c:704: warning: initialization makes pointer from integer without a cast
ring_buffer.c:704: warning: initialization makes pointer from integer without a cast
ring_buffer.c: In function 'rb_head_page_replace':
ring_buffer.c:797: warning: initialization makes integer from pointer without a cast

This patch adds the typecasts inside cmpxchg to annotate that a long is
being cast to a pointer and a pointer is being casted to a long and this
removes the PowerPC warnings.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ring-buffer: consolidate interface of rb_buffer_peek()</title>
<updated>2009-09-10T03:54:02Z</updated>
<author>
<name>Robert Richter</name>
<email>robert.richter@amd.com</email>
</author>
<published>2009-07-31T12:58:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d8eeb2d3b26d25c44c10f28430e2157a2d20bd1d'/>
<id>urn:sha1:d8eeb2d3b26d25c44c10f28430e2157a2d20bd1d</id>
<content type='text'>
rb_buffer_peek() operates with struct ring_buffer_per_cpu *cpu_buffer
only. Thus, instead of passing variables buffer and cpu it is better
to use cpu_buffer directly. This also reduces the risk of races since
cpu_buffer is not calculated twice.

Signed-off-by: Robert Richter &lt;robert.richter@amd.com&gt;
LKML-Reference: &lt;1249045084-3028-1-git-send-email-robert.richter@amd.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ring-buffer: only enable ring_buffer_swap_cpu when needed</title>
<updated>2009-09-04T23:42:22Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-09-04T18:24:40Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=85bac32c4a52c592b857f2c360cc5ec93a097d70'/>
<id>urn:sha1:85bac32c4a52c592b857f2c360cc5ec93a097d70</id>
<content type='text'>
Since the ability to swap the cpu buffers adds a small overhead to
the recording of a trace, we only want to add it when needed.

Only the irqsoff and preemptoff tracers use this feature, and both are
not recommended for production kernels. This patch disables its use
when neither irqsoff nor preemptoff is configured.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ring-buffer: check for swapped buffers in start of committing</title>
<updated>2009-09-04T23:38:42Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-09-04T18:11:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=62f0b3eb5cb58931a02ee4e599e19c80a171e351'/>
<id>urn:sha1:62f0b3eb5cb58931a02ee4e599e19c80a171e351</id>
<content type='text'>
Because the irqsoff tracer can swap an internal CPU buffer, it is possible
that a swap happens between the start of the write and before the committing
bit is set (the committing bit will disable swapping).

This patch adds a check for this and will fail the write if it detects it.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ring-buffer: disable all cpu buffers when one finds a problem</title>
<updated>2009-09-04T15:46:25Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-09-03T23:53:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=077c5407cd3231cf13472623995f0dfdda510d62'/>
<id>urn:sha1:077c5407cd3231cf13472623995f0dfdda510d62</id>
<content type='text'>
Currently the way RB_WARN_ON works, is to disable either the current
CPU buffer or all CPU buffers, depending on whether a ring_buffer or
ring_buffer_per_cpu struct was passed into the macro.

Most users of the RB_WARN_ON pass in the CPU buffer, so only the one
CPU buffer gets disabled but the rest are still active. This may
confuse users even though a warning is sent to the console.

This patch changes the macro to disable the entire buffer even if
the CPU buffer is passed in.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
</feed>
