aboutsummaryrefslogtreecommitdiffstats
path: root/src/tracefs-record.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tracefs-record.c')
-rw-r--r--src/tracefs-record.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tracefs-record.c b/src/tracefs-record.c
index b078c86..8750fe7 100644
--- a/src/tracefs-record.c
+++ b/src/tracefs-record.c
@@ -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