diff options
author | hunt <hunt> | 2007-05-08 20:38:10 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-05-08 20:38:10 +0000 |
commit | 83c5b5febc674ae0810e8dfde55af1d91a2b0b80 (patch) | |
tree | 21082fd490422bf6131401d0fa496ac70b3902e2 /runtime/staprun/relay_old.c | |
parent | 28b44d3c0faedb2f8453570311f21ff255df46dd (diff) | |
download | systemtap-steved-83c5b5febc674ae0810e8dfde55af1d91a2b0b80.tar.gz systemtap-steved-83c5b5febc674ae0810e8dfde55af1d91a2b0b80.tar.xz systemtap-steved-83c5b5febc674ae0810e8dfde55af1d91a2b0b80.zip |
2007-05-08 Martin Hunt <hunt@redhat.com>
Signal handler cleanup.
* mainloop.c (fatal_handler): New. Cleanly handle
unexpected fatal signals.
(setup_main_signals): New. Set signals once mainloop
is entered.
(setup_signals): New. Block certain signals during initialization.
Set handler for fatal signals.
* relay.c (reader_thread): Use ppoll(). Terminate on
SIGUSR2 after reading any remaining data.
(close_relayfs): Remove sleep hack. Send SIGUSR2 to all threads.
Runtime debug messages.
* staprun.h: Change dbug() to accept a debuglevel and
enable it.
* *.c: Modify dbug() calls.
Diffstat (limited to 'runtime/staprun/relay_old.c')
-rw-r--r-- | runtime/staprun/relay_old.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/staprun/relay_old.c b/runtime/staprun/relay_old.c index b0d2e43d..11a73cd7 100644 --- a/runtime/staprun/relay_old.c +++ b/runtime/staprun/relay_old.c @@ -57,7 +57,7 @@ void close_oldrelayfs(int detach) if (!bulkmode) return; - dbug("detach=%d, ncpus=%d\n", detach, ncpus); + dbug(2, "detach=%d, ncpus=%d\n", detach, ncpus); if (detach) { for (i = 0; i < ncpus; i++) @@ -91,7 +91,7 @@ static int open_relayfs_files(int cpu, const char *relay_filebase, const char *p } sprintf(tmp, "%s%d", proc_filebase, cpu); - dbug("Opening %s.\n", tmp); + dbug(2, "Opening %s.\n", tmp); proc_fd[cpu] = open(tmp, O_RDWR | O_NONBLOCK); if (proc_fd[cpu] < 0) { fprintf(stderr, "ERROR: couldn't open proc file %s: errcode = %s\n", tmp, strerror(errno)); @@ -221,7 +221,7 @@ int init_oldrelayfs(void) struct statfs st; char relay_filebase[128], proc_filebase[128]; - dbug("initializing relayfs.n_subbufs=%d subbuf_size=%d\n", n_subbufs, subbuf_size); + dbug(2, "initializing relayfs.n_subbufs=%d subbuf_size=%d\n", n_subbufs, subbuf_size); if (n_subbufs) bulkmode = 1; @@ -265,7 +265,7 @@ int init_oldrelayfs(void) } ncpus = i; - dbug("ncpus=%d\n", ncpus); + dbug(2, "ncpus=%d\n", ncpus); for (i = 0; i < ncpus; i++) { /* create a thread for each per-cpu buffer */ |