diff options
Diffstat (limited to 'gnuradio-core')
-rw-r--r-- | gnuradio-core/gnuradio-core.conf | 3 | ||||
-rw-r--r-- | gnuradio-core/src/lib/runtime/gr_block_executor.cc | 9 |
2 files changed, 10 insertions, 2 deletions
diff --git a/gnuradio-core/gnuradio-core.conf b/gnuradio-core/gnuradio-core.conf index 178b288e8..70eb00236 100644 --- a/gnuradio-core/gnuradio-core.conf +++ b/gnuradio-core/gnuradio-core.conf @@ -5,3 +5,6 @@ [DEFAULT] verbose = False + +[PerfCounters] +on = False diff --git a/gnuradio-core/src/lib/runtime/gr_block_executor.cc b/gnuradio-core/src/lib/runtime/gr_block_executor.cc index 27f591452..6258d99a8 100644 --- a/gnuradio-core/src/lib/runtime/gr_block_executor.cc +++ b/gnuradio-core/src/lib/runtime/gr_block_executor.cc @@ -28,6 +28,7 @@ #include <gr_block.h> #include <gr_block_detail.h> #include <gr_buffer.h> +#include <gr_prefs.h> #include <boost/thread.hpp> #include <boost/format.hpp> #include <iostream> @@ -179,6 +180,8 @@ gr_block_executor::~gr_block_executor () gr_block_executor::state gr_block_executor::run_one_iteration() { + gr_prefs *prefs = gr_prefs::singleton(); + int noutput_items; int max_items_avail; int max_noutput_items = d_max_noutput_items; @@ -420,7 +423,8 @@ gr_block_executor::run_one_iteration() d_start_nitems_read[i] = d->nitems_read(i); #ifdef GR_PERFORMANCE_COUNTERS - d->start_perf_counters(); + if(prefs->get_bool("PerfCounters", "on", false)) + d->start_perf_counters(); #endif /* GR_PERFORMANCE_COUNTERS */ // Do the actual work of the block @@ -428,7 +432,8 @@ gr_block_executor::run_one_iteration() d_input_items, d_output_items); #ifdef GR_PERFORMANCE_COUNTERS - d->stop_perf_counters(noutput_items, n); + if(prefs->get_bool("PerfCounters", "on", false)) + d->stop_perf_counters(noutput_items, n); #endif /* GR_PERFORMANCE_COUNTERS */ LOG(*d_log << " general_work: noutput_items = " << noutput_items |