]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - kernel/trace/trace.c
tracing: Clean up tracing_fill_pipe_page()
authorSteven Rostedt (Red Hat) <rostedt@goodmis.org>
Mon, 17 Nov 2014 18:12:22 +0000 (13:12 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Thu, 20 Nov 2014 03:01:14 +0000 (22:01 -0500)
commit74f06bb72347302a19aac087314388ebd0e4fee9
tree214e56f4c4fc93f1954631c1f28bcdfa65de627e
parenteeab98154dc0b49afd398afdd71c464a8af5911f
tracing: Clean up tracing_fill_pipe_page()

The function tracing_fill_pipe_page() logic is a little confusing with the
use of count saving the seq.len and reusing it.

Instead of subtracting a number that is calculated from the saved
value of the seq.len from seq.len, just save the seq.len at the start
and if we need to reset it, just assign it again.

When the seq_buf overflow is len == size + 1, the current logic will
break. Changing it to use a saved length for resetting back to the
original value is more robust and will work when we change the way
seq_buf sets the overflow.

Link: http://lkml.kernel.org/r/20141118161546.GJ23958@pathway.suse.cz
Reviewed-by: Petr Mladek <pmladek@suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace.c