]> sourceware.org Git - systemtap.git/commitdiff
PR14927: make more warnings from staprun/stapdyn sensitive to -w
authorJonathan Lebon <jlebon@redhat.com>
Tue, 9 Jul 2013 13:50:48 +0000 (09:50 -0400)
committerJonathan Lebon <jlebon@redhat.com>
Tue, 9 Jul 2013 18:02:08 +0000 (14:02 -0400)
Before, even with the -w option specified for staprun, some warnings
(such as when the child process exits with a nonzero code) were still
output. Now, all warnings are affected by -w.

A similar operation was carried out in stapdyn, where the use of warnx()
was changed to stapwarn() so that -w now silences them. This changes
also gives those warnings the chance to be colored if necessary.

stapdyn/dynutil.cxx
staprun/staprun.h

index 54d1c584653c09b739692d281f1166f5c09055d0..919d890a94bd08d545f36466a3fda6f3fd864ebe 100644 (file)
@@ -143,20 +143,20 @@ check_dyninst_exit(BPatch_process *process)
       code = process->getExitCode();
       if (code == EXIT_SUCCESS)
         return true;
-      warnx("Warning: child process exited with status %d", code);
+      stapwarn() << "Child process exited with status " << code << endl;
       return false;
 
     case ExitedViaSignal:
       code = process->getExitSignal();
-      warnx("Warning: child process exited with signal %d (%s)",
-            code, strsignal(code));
+      stapwarn() << "Child process exited with signal " << code
+            << " (" << strsignal(code) << ")" << endl;
       return false;
 
     case NoExit:
       if (process->isTerminated())
-        warnx("Warning: child process exited in an unknown manner");
+        stapwarn() << "Child process exited in an unknown manner" << endl;
       else
-        warnx("Warning: child process has not exited");
+        stapwarn() << "Child process has not exited" << endl;
       return false;
 
     default:
index 836c0558cb2d1781046ef1cf5d4717f17494c84e..1ae856510120d076bc9c0d74c7323463fe150c39 100644 (file)
@@ -88,6 +88,8 @@ extern char *__name__;
        } while (0)
 
 #define warn(args...) do {     \
+               if (suppress_warnings)  \
+                       break;          \
                print_color("warning"); \
                eprintf(_("WARNING:")); \
                print_color(NULL); \
This page took 0.026443 seconds and 5 git commands to generate.