@@ -319,6 +319,7 @@ int tracefs_cpu_read(struct tracefs_cpu *tcpu, void *buffer, bool nonblock)
static int init_splice(struct tracefs_cpu *tcpu)
{
+ char *buf;
int ret;
if (tcpu->splice_pipe[0] >= 0)
@@ -328,6 +329,12 @@ static int init_splice(struct tracefs_cpu *tcpu)
if (ret < 0)
return ret;
+ if (str_read_file("/proc/sys/fs/pipe-max-size", &buf, false)) {
+ int size = atoi(buf);
+ fcntl(tcpu->splice_pipe[0], F_SETPIPE_SZ, &size);
+ free(buf);
+ }
+
ret = fcntl(tcpu->splice_pipe[0], F_GETPIPE_SZ, &tcpu->pipe_size);
/*
* F_GETPIPE_SZ was introduced in 2.6.35, ftrace was introduced