lkml.org 
[lkml]   [2008]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2008-11-13 14:23    [W:0.057 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site