diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-04-30 13:46:57 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-04-30 13:46:57 +0200 |
commit | bbb0ead7e82edd3081ebd9243655b851b0ab4779 (patch) | |
tree | d0888a46810e74d91dc27d385e8c78358be267bb | |
parent | 8a82f67e2cb3366ab6988bcb56eb06c1d56fdc5d (diff) |
Don't print scheduler statistics at verbosity level 2, add --stat instead
-rw-r--r-- | build2/b-options.cxx | 6 | ||||
-rw-r--r-- | build2/b-options.hxx | 4 | ||||
-rw-r--r-- | build2/b-options.ixx | 6 | ||||
-rw-r--r-- | build2/b.cli | 5 | ||||
-rw-r--r-- | build2/b.cxx | 5 |
5 files changed, 24 insertions, 2 deletions
diff --git a/build2/b-options.cxx b/build2/b-options.cxx index 3cfb708..df39b2b 100644 --- a/build2/b-options.cxx +++ b/build2/b-options.cxx @@ -597,6 +597,7 @@ namespace build2 quiet_ (), verbose_ (1), verbose_specified_ (false), + stat_ (), jobs_ (), jobs_specified_ (false), max_jobs_ (), @@ -733,6 +734,9 @@ namespace build2 << " 6. Even more detailed information, including state dumps." << ::std::endl; os << std::endl + << "\033[1m--stat\033[0m Display build statistics." << ::std::endl; + + os << std::endl << "\033[1m--jobs\033[0m|\033[1m-j\033[0m \033[4mnum\033[0m Number of active jobs to perform in parallel. This" << ::std::endl << " includes both the number of active threads inside the" << ::std::endl << " build system as well as the number of external commands" << ::std::endl @@ -881,6 +885,8 @@ namespace build2 _cli_options_map_["--verbose"] = &::build2::cl::thunk< options, uint16_t, &options::verbose_, &options::verbose_specified_ >; + _cli_options_map_["--stat"] = + &::build2::cl::thunk< options, bool, &options::stat_ >; _cli_options_map_["--jobs"] = &::build2::cl::thunk< options, size_t, &options::jobs_, &options::jobs_specified_ >; diff --git a/build2/b-options.hxx b/build2/b-options.hxx index cab4951..c9eed77 100644 --- a/build2/b-options.hxx +++ b/build2/b-options.hxx @@ -429,6 +429,9 @@ namespace build2 bool verbose_specified () const; + const bool& + stat () const; + const size_t& jobs () const; @@ -530,6 +533,7 @@ namespace build2 bool quiet_; uint16_t verbose_; bool verbose_specified_; + bool stat_; size_t jobs_; bool jobs_specified_; size_t max_jobs_; diff --git a/build2/b-options.ixx b/build2/b-options.ixx index 33cb18a..0691f12 100644 --- a/build2/b-options.ixx +++ b/build2/b-options.ixx @@ -264,6 +264,12 @@ namespace build2 return this->verbose_specified_; } + inline const bool& options:: + stat () const + { + return this->stat_; + } + inline const size_t& options:: jobs () const { diff --git a/build2/b.cli b/build2/b.cli index d054d05..6f5d26d 100644 --- a/build2/b.cli +++ b/build2/b.cli @@ -441,6 +441,11 @@ namespace build2 \li|Even more detailed information, including state dumps.||" } + bool --stat + { + "Display build statistics." + } + size_t --jobs|-j { "<num>", diff --git a/build2/b.cxx b/build2/b.cxx index b73a0d6..ba84b1c 100644 --- a/build2/b.cxx +++ b/build2/b.cxx @@ -1393,9 +1393,10 @@ main (int argc, char* argv[]) // assert (st.task_queue_remain == 0); - if (verb >= (st.thread_max_active > 1 ? 3 : 4)) + if (ops.stat ()) { - info << "scheduler statistics:" << "\n\n" + text << '\n' + << "build statistics:" << "\n\n" << " thread_max_active " << st.thread_max_active << '\n' << " thread_max_total " << st.thread_max_total << '\n' << " thread_helpers " << st.thread_helpers << '\n' |