]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
tracing: Do not return EINVAL in snapshot when not allocated
authorSteven Rostedt (Red Hat) <srostedt@redhat.com>
Tue, 5 Mar 2013 15:53:02 +0000 (10:53 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 7 Mar 2013 15:31:38 +0000 (10:31 -0500)
To use the tracing snapshot feature, writing a '1' into the snapshot
file causes the snapshot buffer to be allocated if it has not already
been allocated and dose a 'swap' with the main buffer, so that the
snapshot now contains what was in the main buffer, and the main buffer
now writes to what was the snapshot buffer.

To free the snapshot buffer, a '0' is written into the snapshot file.

To clear the snapshot buffer, any number but a '0' or '1' is written
into the snapshot file. But if the file is not allocated it returns
-EINVAL error code. This is rather pointless. It is better just to
do nothing and return success.

Acked-by: Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c

index 9e3120b8a2ad97e835e391e966faa4f0991cad71..1f835a83cb2c4c74b13b0c8641ce648a75591ae6 100644 (file)
@@ -4167,8 +4167,6 @@ tracing_snapshot_write(struct file *filp, const char __user *ubuf, size_t cnt,
        default:
                if (current_trace->allocated_snapshot)
                        tracing_reset_online_cpus(&max_tr);
-               else
-                       ret = -EINVAL;
                break;
        }