Skip to content

Commit c9960e4

Browse files
Steven Rostedt (Red Hat)rostedt
authored andcommitted
tracing: Do not return EINVAL in snapshot when not allocated
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 <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent d8741e2 commit c9960e4

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

kernel/trace/trace.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4167,8 +4167,6 @@ tracing_snapshot_write(struct file *filp, const char __user *ubuf, size_t cnt,
41674167
default:
41684168
if (current_trace->allocated_snapshot)
41694169
tracing_reset_online_cpus(&max_tr);
4170-
else
4171-
ret = -EINVAL;
41724170
break;
41734171
}
41744172

0 commit comments

Comments
 (0)