tracing: Fix setting tracer specific options
authorSteven Rostedt <srostedt@redhat.com>
Tue, 22 Dec 2009 03:35:16 +0000 (22:35 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 22 Dec 2009 03:35:16 +0000 (22:35 -0500)
The function __set_tracer_option() takes as its last parameter a
"neg" value. If set it should negate the value of the option.

The trace_options_write() passed the value written to the file
which is what the new value needs to be set as. But since this
is not the negative, it never sets the value.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Cc: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c

index ee61915935d55568bc1455d52d0619ab5850e17a..d0a4c12d1f1cc47b73fc09767a20a93bf84bc85a 100644 (file)
@@ -3949,7 +3949,7 @@ trace_options_write(struct file *filp, const char __user *ubuf, size_t cnt,
        if (!!(topt->flags->val & topt->opt->bit) != val) {
                mutex_lock(&trace_types_lock);
                ret = __set_tracer_option(current_trace, topt->flags,
-                                         topt->opt, val);
+                                         topt->opt, !val);
                mutex_unlock(&trace_types_lock);
                if (ret)
                        return ret;