lkml.org 
[lkml]   [2016]   [May]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count
On Wed, May 25, 2016 at 03:16:40PM +0200, Peter Zijlstra wrote:
> On Tue, May 24, 2016 at 03:52:28PM -0700, Andy Lutomirski wrote:
> > + struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer);
> >
> > + if (!buffer || buffer->nesting >= 4)
> > return NULL;
>
> This is buggy fwiw; you need to unconditionally increment
> buffer->nesting to match the unconditional decrement.
>
> Otherwise 5 'increments' and 5 decrements will land you at -1.

Urgh, never mind me; if you don't dec when returning NULL this should
work out fine.

My head really aint working right today.

\
 
 \ /
  Last update: 2016-05-25 20:41    [W:0.096 / U:0.236 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site