Message ID | 20220928095753.54b6621c@gandalf.local.home (mailing list archive) |
---|---|
State | Accepted |
Commit | ae6db8e45cc1e6dc97f2d1f695b0490e5769fce0 |
Headers | show |
Series | trace-cmd record: Use result of fcntl(GETPIPE_SZ) | expand |
diff --git a/lib/trace-cmd/trace-recorder.c b/lib/trace-cmd/trace-recorder.c index c7ef13c851d2..25c26def3784 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;