summaryrefslogtreecommitdiffstats
path: root/runtime/staprun/staprun.h
diff options
context:
space:
mode:
authorhunt <hunt>2007-05-08 20:38:10 +0000
committerhunt <hunt>2007-05-08 20:38:10 +0000
commit83c5b5febc674ae0810e8dfde55af1d91a2b0b80 (patch)
tree21082fd490422bf6131401d0fa496ac70b3902e2 /runtime/staprun/staprun.h
parent28b44d3c0faedb2f8453570311f21ff255df46dd (diff)
downloadsystemtap-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.h6
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