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.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/staprun.c')
-rw-r--r-- | runtime/staprun/staprun.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/runtime/staprun/staprun.c b/runtime/staprun/staprun.c index 4ead7018..f40f676d 100644 --- a/runtime/staprun/staprun.c +++ b/runtime/staprun/staprun.c @@ -65,7 +65,7 @@ static void usage(char *prog) { fprintf(stderr, "\n%s [-v] [-c cmd ] [-x pid] [-u user]\n" "\t[-A modname]] [-L] [-b bufsize] [-o FILE] kmod-name [kmod-options]\n", prog); - fprintf(stderr, "-v Verbose.\n"); + fprintf(stderr, "-v increase Verbosity.\n"); fprintf(stderr, "-c cmd. Command \'cmd\' will be run and staprun will exit when it does.\n"); fprintf(stderr, " _stp_target will contain the pid for the command.\n"); fprintf(stderr, "-x pid. Sets _stp_target to pid.\n"); @@ -84,10 +84,12 @@ int main(int argc, char **argv) { int c; + setup_signals(); + while ((c = getopt(argc, argv, "ALvb:t:d:c:o:u:x:")) != EOF) { switch (c) { case 'v': - verbose = 1; + verbose++; break; case 'b': { @@ -136,7 +138,7 @@ int main(int argc, char **argv) if (optind < argc) { modpath = argv[optind++]; path_parse_modname(modpath); - dbug("modpath=\"%s\", modname=\"%s\"\n", modpath, modname); + dbug(2, "modpath=\"%s\", modname=\"%s\"\n", modpath, modname); } if (optind < argc) { |