params: add multi-level verbosity
authorBrian Norris <banorris@uci.edu>
Fri, 31 May 2013 23:45:42 +0000 (16:45 -0700)
committerBrian Norris <banorris@uci.edu>
Fri, 31 May 2013 23:45:42 +0000 (16:45 -0700)
Now we can have --verbose=[012], so that the default (0) is still quiet,
the easy verbose flag (--verbose or -v) is noisy but useful (1), and if
you really want some extra noise, you can choose (2). Right now, there
is some minimal extra noise in (2), but this may be expanded if we want
more run-time debuggability, rather than recompiling with 'make debug'.

main.cc
model.cc
params.h

diff --git a/main.cc b/main.cc
index 32c153d..8416a79 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -75,7 +75,9 @@ static void print_usage(const char *program_name, struct model_params *params)
 "                              Default: %d\n"
 "-b, --bound=MAX             Upper length bound.\n"
 "                              Default: %d\n"
 "                              Default: %d\n"
 "-b, --bound=MAX             Upper length bound.\n"
 "                              Default: %d\n"
-"-v, --verbose               Print verbose execution information.\n"
+"-v[NUM], --verbose[=NUM]    Print verbose execution information. NUM is optional:\n"
+"                              0 is quiet; 1 is noisy; 2 is noisier.\n"
+"                              Default: %d\n"
 "-u, --uninitialized=VALUE   Return VALUE any load which may read from an\n"
 "                              uninitialized atomic.\n"
 "                              Default: %u\n"
 "-u, --uninitialized=VALUE   Return VALUE any load which may read from an\n"
 "                              uninitialized atomic.\n"
 "                              Default: %u\n"
@@ -93,6 +95,7 @@ static void print_usage(const char *program_name, struct model_params *params)
                params->fairwindow,
                params->enabledcount,
                params->bound,
                params->fairwindow,
                params->enabledcount,
                params->bound,
+               params->verbose,
                params->uninitvalue);
        model_print("Analysis plugins:\n");
        for(unsigned int i=0;i<registeredanalysis->size();i++) {
                params->uninitvalue);
        model_print("Analysis plugins:\n");
        for(unsigned int i=0;i<registeredanalysis->size();i++) {
index 90ef906..466bf61 100644 (file)
--- a/model.cc
+++ b/model.cc
@@ -254,7 +254,7 @@ void ModelChecker::print_execution(bool printbugs) const
 {
        print_program_output();
 
 {
        print_program_output();
 
-       if (params.verbose) {
+       if (params.verbose >= 2) {
                model_print("Earliest divergence point since last feasible execution:\n");
                if (earliest_diverge)
                        earliest_diverge->print();
                model_print("Earliest divergence point since last feasible execution:\n");
                if (earliest_diverge)
                        earliest_diverge->print();
index 0eda8bf..ac5dd96 100644 (file)
--- a/params.h
+++ b/params.h
@@ -24,7 +24,7 @@ struct model_params {
         *  value */
        unsigned int expireslop;
 
         *  value */
        unsigned int expireslop;
 
-       /** @brief Verbosity (0 = quiet; 1 = noisy) */
+       /** @brief Verbosity (0 = quiet; 1 = noisy; 2 = noisier) */
        int verbose;
 
        /** @brief Command-line argument count to pass to user program */
        int verbose;
 
        /** @brief Command-line argument count to pass to user program */