]> sourceware.org Git - systemtap.git/commitdiff
PR7097: in flight-recorder-launch mode, don't open the stapio output files early
authorFrank Ch. Eigler <fche@elastic.org>
Thu, 22 Jul 2010 18:35:25 +0000 (14:35 -0400)
committerFrank Ch. Eigler <fche@elastic.org>
Thu, 22 Jul 2010 18:36:28 +0000 (14:36 -0400)
* runtime/staprun/relay.c (init_relayfs): Return early if load_only.

runtime/staprun/relay.c

index 39a2f39344264d7a513a597c197f5adca3b06ff4..28fba651d8348117db2de4435bd99bb5b21b20e7 100644 (file)
@@ -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;
 }
This page took 0.024586 seconds and 5 git commands to generate.