Messages in this thread | | | Date | Thu, 13 Nov 2008 14:19:39 +0100 | From | Ingo Molnar <> | Subject | Re: [PATCH v2 1/1] ftrace: do not update max buffer with no users |
| |
* Steven Rostedt <rostedt@goodmis.org> wrote:
> The line count is very misleading. The 83 insertions and deletions where > moved code or indentation:
but that indentation is completely unnecessary:
> - ret = ring_buffer_resize(max_tr.buffer, val); > - if (ret < 0) { > - int r; > - cnt = ret; > - r = ring_buffer_resize(global_trace.buffer, > - global_trace.entries); > - if (r < 0) { > - /* AARGH! We are left with different > - * size max buffer!!!! */ > - WARN_ON(1); > - tracing_disabled = 1; > } > - goto out; > } > > > + if (max_tr.buffer) { > + ret = ring_buffer_resize(max_tr.buffer, val); > + if (ret < 0) { > + int r; > + cnt = ret; > + r = ring_buffer_resize(global_trace.buffer, > + global_trace.entries); > + if (r < 0) { > + /* AARGH! We are left with different > + * size max buffer!!!! */ > + WARN_ON(1); > + tracing_disabled = 1; > + } > + goto out; > } > }
the obvious solution is to add this to ring_buffer_resize():
if (!buffer) return size;
resizing a non-existent buffer should succeed. A two-liner patch. Not 160 lines of flux.
Really, you need to think _hard_ how to avoid invasive-looking changes in late -rc's, because every extra line to review uses up precious review resources.
Ingo
| |