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/staprun.h | |
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/staprun.h')
-rw-r--r-- | runtime/staprun/staprun.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/runtime/staprun/staprun.h b/runtime/staprun/staprun.h index c3599de6..f8fcfe66 100644 --- a/runtime/staprun/staprun.h +++ b/runtime/staprun/staprun.h @@ -34,10 +34,11 @@ #include <sys/statfs.h> #include <linux/version.h> +#define DEBUG #ifdef DEBUG -#define dbug(args...) {fprintf(stderr,"%s:%d ",__FUNCTION__, __LINE__); fprintf(stderr,args); } +#define dbug(level, args...) {if (verbose>=level) {fprintf(stderr,"%s:%d ",__FUNCTION__, __LINE__); fprintf(stderr,args);}} #else -#define dbug(args...) ; +#define dbug(level, args...) ; #endif /* DEBUG */ #define err(args...) {fprintf(stderr,"%s:%d ",__FUNCTION__, __LINE__); fprintf(stderr,args); } @@ -69,6 +70,7 @@ int init_relayfs(void); void close_relayfs(void); int init_oldrelayfs(void); void close_oldrelayfs(int); +void setup_signals(void); /* * variables |