diff options
-rw-r--r-- | runtime/staprun/ChangeLog | 6 | ||||
-rw-r--r-- | runtime/staprun/relay.c | 19 | ||||
-rw-r--r-- | runtime/staprun/relay_old.c | 19 |
3 files changed, 27 insertions, 17 deletions
diff --git a/runtime/staprun/ChangeLog b/runtime/staprun/ChangeLog index 540153d7..5cd036fd 100644 --- a/runtime/staprun/ChangeLog +++ b/runtime/staprun/ChangeLog @@ -1,3 +1,9 @@ +2007-12-11 Martin Hunt <hunt@redhat.com> + PR5368 + * relay_old.c (init_oldrelayfs): Don't start threads + if load_only. + * relay.c (init_relayfs): Ditto. + 2007-11-09 Martin Hunt <hunt@redhat.com> * mainloop.c (stp_main_loop): Bump recvbuf to 8196 for diff --git a/runtime/staprun/relay.c b/runtime/staprun/relay.c index 538d027c..19621933 100644 --- a/runtime/staprun/relay.c +++ b/runtime/staprun/relay.c @@ -97,7 +97,6 @@ static void *reader_thread(void *data) _perr("poll error"); return(NULL); } - stop_threads = 1; } while ((rc = read(relay_fd[cpu], buf, sizeof(buf))) > 0) { if (write(out_fd[cpu], buf, rc) != rc) { @@ -201,15 +200,17 @@ int init_relayfs(void) out_fd[0] = STDOUT_FILENO; } - 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; + if (!load_only) { + 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; } diff --git a/runtime/staprun/relay_old.c b/runtime/staprun/relay_old.c index f138aee5..bd746f19 100644 --- a/runtime/staprun/relay_old.c +++ b/runtime/staprun/relay_old.c @@ -303,14 +303,17 @@ int init_oldrelayfs(void) return -1; } - for (i = 0; i < ncpus; i++) { - /* create a thread for each per-cpu buffer */ - if (pthread_create(&reader[i], NULL, reader_thread, (void *)(long)i) < 0) { - int saved_errno = errno; - close_relayfs_files(i); - err("ERROR: Couldn't create reader thread, cpu = %d: %s\n", - i, strerror(saved_errno)); - goto err; + if (!load_only) { + dbug(2, "starting threads\n"); + for (i = 0; i < ncpus; i++) { + /* create a thread for each per-cpu buffer */ + if (pthread_create(&reader[i], NULL, reader_thread, (void *)(long)i) < 0) { + int saved_errno = errno; + close_relayfs_files(i); + err("ERROR: Couldn't create reader thread, cpu = %d: %s\n", + i, strerror(saved_errno)); + goto err; + } } } return 0; |