aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteven Rostedt (Google) <rostedt@goodmis.org>2022-09-28 09:57:53 -0400
committerSteven Rostedt (Google) <rostedt@goodmis.org>2022-09-28 15:31:51 -0400
commitae6db8e45cc1e6dc97f2d1f695b0490e5769fce0 (patch)
tree3495c2fae9626168a1029ac8a06d30a79f2aae2d
parenteecafd5de17fabfb76d7f42a3de92dcaf451c2e8 (diff)
downloadtrace-cmd-ae6db8e45cc1e6dc97f2d1f695b0490e5769fce0.tar.gz
trace-cmd record: Use result of fcntl(GETPIPE_SZ)
For some reason, I thought the arg to fcntl(fd, F_GETPIPE_SZ, &arg) would give the pipe size. But the argument is completely ignored (I remember testing this, and it worked :-/) The return of the function is the pipe size. Use that if pipe_size is untouched (which it ought to be) as the pipe size. Link: https://lore.kernel.org/linux-trace-devel/20220928095753.54b6621c@gandalf.local.home Fixes: a64fab23cec2 ("trace-cmd recorder: Use full pipe size in splice_data()") Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r--lib/trace-cmd/trace-recorder.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/trace-cmd/trace-recorder.c b/lib/trace-cmd/trace-recorder.c
index c7ef13c8..25c26def 100644
--- a/lib/trace-cmd/trace-recorder.c
+++ b/lib/trace-cmd/trace-recorder.c
@@ -204,7 +204,9 @@ tracecmd_create_buffer_recorder_fd2(int fd, int fd2, int cpu, unsigned flags,
* back to using page_size for splice(). It could also return
* success, but not modify pipe_size.
*/
- if (ret < 0 || !pipe_size)
+ if (ret > 0 && !pipe_size)
+ pipe_size = ret;
+ else if (ret < 0)
pipe_size = recorder->page_size;
recorder->pipe_size = pipe_size;