summaryrefslogtreecommitdiff
path: root/gnuradio-core/src/lib
diff options
context:
space:
mode:
authorTom Rondeau2013-02-16 14:45:43 -0500
committerTom Rondeau2013-02-16 14:46:52 -0500
commit55028034dbad37c07c4675c88fccb460218ee924 (patch)
tree50a78b3f5b2f44f68989c6b5aa9db641ad8a2f5e /gnuradio-core/src/lib
parent8827ecc87eca9a1e970dd2ba5da0731cd9db0e98 (diff)
downloadgnuradio-55028034dbad37c07c4675c88fccb460218ee924.tar.gz
gnuradio-55028034dbad37c07c4675c88fccb460218ee924.tar.bz2
gnuradio-55028034dbad37c07c4675c88fccb460218ee924.zip
core: adding and using a PerfCounters section to the config files.
gr_block_executor will read the config files to determine if the perf counters are on or off.
Diffstat (limited to 'gnuradio-core/src/lib')
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block_executor.cc9
1 files changed, 7 insertions, 2 deletions
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