From 552459b2eb56e8e34206d8d9b4b1d7a51c29f226 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Thu, 22 Jul 2010 14:35:25 -0400 Subject: [PATCH] PR7097: in flight-recorder-launch mode, don't open the stapio output files early * runtime/staprun/relay.c (init_relayfs): Return early if load_only. --- runtime/staprun/relay.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/runtime/staprun/relay.c b/runtime/staprun/relay.c index 39a2f3934..28fba651d 100644 --- a/runtime/staprun/relay.c +++ b/runtime/staprun/relay.c @@ -234,7 +234,8 @@ int init_relayfs(void) struct statfs st; char rqbuf[128]; char buf[PATH_MAX], relay_filebase[PATH_MAX]; - + struct sigaction sa; + dbug(2, "initializing relayfs\n"); reader[0] = (pthread_t)0; @@ -277,6 +278,10 @@ int init_relayfs(void) return -1; } + /* PR7097 */ + if (load_only) + return 0; + if (fsize_max) { /* switch file mode */ for (i = 0; i < ncpus; i++) { @@ -335,22 +340,19 @@ int init_relayfs(void) out_fd[0] = STDOUT_FILENO; } - if (!load_only) { - struct sigaction sa; - sa.sa_handler = switchfile_handler; - sa.sa_flags = 0; - sigemptyset(&sa.sa_mask); - sigaction(SIGUSR2, &sa, NULL); - dbug(2, "starting threads\n"); - for (i = 0; i < ncpus; i++) { - if (pthread_create(&reader[i], NULL, reader_thread, - (void *)(long)i) < 0) { - _perr("failed to create thread"); - return -1; - } - } - } + sa.sa_handler = switchfile_handler; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(SIGUSR2, &sa, NULL); + dbug(2, "starting threads\n"); + for (i = 0; i < ncpus; i++) { + if (pthread_create(&reader[i], NULL, reader_thread, + (void *)(long)i) < 0) { + _perr("failed to create thread"); + return -1; + } + } return 0; } -- 2.43.5