summaryrefslogtreecommitdiff
path: root/gnuradio-core
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2013-02-16 14:45:43 -0500
committerTom Rondeau <trondeau@vt.edu>2013-02-16 14:46:52 -0500
commit55028034dbad37c07c4675c88fccb460218ee924 (patch)
tree50a78b3f5b2f44f68989c6b5aa9db641ad8a2f5e /gnuradio-core
parent8827ecc87eca9a1e970dd2ba5da0731cd9db0e98 (diff)
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')
-rw-r--r--gnuradio-core/gnuradio-core.conf3
-rw-r--r--gnuradio-core/src/lib/runtime/gr_block_executor.cc9
2 files changed, 10 insertions, 2 deletions
diff --git a/gnuradio-core/gnuradio-core.conf b/gnuradio-core/gnuradio-core.conf
index 178b288e8d..70eb00236c 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 27f591452d..6258d99a80 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