-
-
Save kerneltoast/460801e4e497aca8759e2516f5d36863 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/staprun/relay.c b/staprun/relay.c | |
index 3eb8df34b..d0202e52f 100644 | |
--- a/staprun/relay.c | |
+++ b/staprun/relay.c | |
@@ -232,10 +232,17 @@ static void *reader_thread(void *data) | |
wbuf += bytes; | |
wsize += bytes; | |
} else { | |
- rc = write(out_fd[cpu], wbuf, wbytes); | |
+ int fd; | |
+ /* Only bulkmode and fsize_max use per-cpu output files. Otherwise, | |
+ there's just a single output fd stored at out_fd[avail_cpus[0]]. */ | |
+ if (bulkmode || fsize_max) | |
+ fd = out_fd[cpu]; | |
+ else | |
+ fd = out_fd[avail_cpus[0]]; | |
+ rc = write(fd, wbuf, wbytes); | |
if (rc <= 0) { | |
perr("Couldn't write to output %d for cpu %d, exiting.", | |
- out_fd[cpu], cpu); | |
+ fd, cpu); | |
goto error_out; | |
} | |
wbytes -= rc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment