Re: [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count

2016-05-25 Thread Andy Lutomirski
On Wed, May 25, 2016 at 6:20 AM, Namhyung Kim wrote: > Hi Andy, >> - out: >> + >> +out_nobuffer: >> + put_trace_buf(); >> + >> +out: > > Shouldn't the labels be reversed like below? > > out: > put_trace_buf(); > > out_nobuffer: Yes. I'll send a new version. --Andy

Re: [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count

2016-05-25 Thread Andy Lutomirski
On May 25, 2016 6:16 AM, "Peter Zijlstra" wrote: > > On Tue, May 24, 2016 at 03:52:28PM -0700, Andy Lutomirski wrote: > > Currently, the trace_printk code chooses which static buffer to use based > > on what type of atomic context (NMI, IRQ, etc) it's in. Simplify the > > code and make it more ro

Re: [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count

2016-05-25 Thread Peter Zijlstra
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; > > Thi

Re: [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count

2016-05-25 Thread Steven Rostedt
On Wed, 25 May 2016 15:16:40 +0200 Peter Zijlstra wrote: > > static char *get_trace_buf(void) > > { > > + struct trace_buffer_struct *buffer = this_cpu_ptr(trace_percpu_buffer); > > > > + if (!buffer || buffer->nesting >= 4) > > return NULL; > > This is buggy fwiw; you need

Re: [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count

2016-05-25 Thread Namhyung Kim
Hi Andy, On Wed, May 25, 2016 at 7:52 AM, Andy Lutomirski wrote: > Currently, the trace_printk code chooses which static buffer to use based > on what type of atomic context (NMI, IRQ, etc) it's in. Simplify the > code and make it more robust: simply count the nesting depth and choose > a buffer

Re: [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count

2016-05-25 Thread Peter Zijlstra
On Tue, May 24, 2016 at 03:52:28PM -0700, Andy Lutomirski wrote: > Currently, the trace_printk code chooses which static buffer to use based > on what type of atomic context (NMI, IRQ, etc) it's in. Simplify the > code and make it more robust: simply count the nesting depth and choose > a buffer b

Re: [PATCH] tracing: Choose static tp_printk buffer by explicit nesting count

2016-05-24 Thread Steven Rostedt
On Tue, 24 May 2016 15:52:28 -0700 Andy Lutomirski wrote: > Currently, the trace_printk code chooses which static buffer to use based > on what type of atomic context (NMI, IRQ, etc) it's in. Simplify the > code and make it more robust: simply count the nesting depth and choose > a buffer based

[PATCH] tracing: Choose static tp_printk buffer by explicit nesting count

2016-05-24 Thread Andy Lutomirski
Currently, the trace_printk code chooses which static buffer to use based on what type of atomic context (NMI, IRQ, etc) it's in. Simplify the code and make it more robust: simply count the nesting depth and choose a buffer based on the current nesting depth. The new code will only drop an event