[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 01/01: Bug fix: performance counter's clock
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 01/01: Bug fix: performance counter's clock option (i.e. thread or monotonic) was honored only if controlport was enabled. |
Date: |
Mon, 26 Sep 2016 12:01:52 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
jcorgan pushed a commit to branch maint
in repository gnuradio.
commit 807bba681d56589d2f02cd6227181d9abc796e17
Author: Pedro Lobo <address@hidden>
Date: Mon Sep 26 11:45:45 2016 +0200
Bug fix: performance counter's clock option (i.e. thread or monotonic) was
honored only if controlport was enabled.
---
gnuradio-runtime/lib/top_block.cc | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/gnuradio-runtime/lib/top_block.cc
b/gnuradio-runtime/lib/top_block.cc
index 8918a8f..7d13508 100644
--- a/gnuradio-runtime/lib/top_block.cc
+++ b/gnuradio-runtime/lib/top_block.cc
@@ -59,6 +59,17 @@ namespace gr {
void
top_block::start(int max_noutput_items)
{
+#ifdef GNURADIO_HRT_USE_CLOCK_GETTIME
+ std::string initial_clock = prefs::singleton()->get_string("PerfCounters",
"clock", "thread");
+ if(initial_clock.compare("thread") == 0){
+ gr::high_res_timer_source = CLOCK_THREAD_CPUTIME_ID;
+ } else if(initial_clock.compare("monotonic") == 0){
+ gr::high_res_timer_source = CLOCK_MONOTONIC;
+ } else {
+ throw std::runtime_error("bad argument for PerfCounters.clock!");
+ }
+#endif
+
d_impl->start(max_noutput_items);
if(prefs::singleton()->get_bool("ControlPort", "on", false)) {
@@ -186,14 +197,6 @@ namespace gr {
}
#ifdef GNURADIO_HRT_USE_CLOCK_GETTIME
- std::string initial_clock = prefs::singleton()->get_string("PerfCounters",
"clock", "thread");
- if(initial_clock.compare("thread") == 0){
- gr::high_res_timer_source = CLOCK_THREAD_CPUTIME_ID;
- } else if(initial_clock.compare("monotonic") == 0){
- gr::high_res_timer_source = CLOCK_MONOTONIC;
- } else {
- throw std::runtime_error("bad argument for PerfCounters.clock!");
- }
add_rpc_variable(
rpcbasic_sptr(new rpcbasic_register_variable_rw<int>(
alias(), "perfcounter_clock",