From e24e6d149ae6395c93d8c0df4d806e05971fc281 Mon Sep 17 00:00:00 2001
From: Tom Rondeau <tom@trondeau.com>
Date: Fri, 6 Sep 2013 13:25:43 -0400
Subject: runtime: Added a Performance Counter that stores the accumulated
 work_time counter (work_time_total).

---
 gnuradio-runtime/lib/block.cc | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

(limited to 'gnuradio-runtime/lib/block.cc')

diff --git a/gnuradio-runtime/lib/block.cc b/gnuradio-runtime/lib/block.cc
index 7a55e09561..e76daefe48 100644
--- a/gnuradio-runtime/lib/block.cc
+++ b/gnuradio-runtime/lib/block.cc
@@ -635,6 +635,17 @@ namespace gr {
     }
   }
 
+  float
+  block::pc_work_time_total()
+  {
+    if(d_detail) {
+      return d_detail->pc_work_time_total();
+    }
+    else {
+      return 0;
+    }
+  }
+
   void
   block::reset_perf_counters()
   {
@@ -711,6 +722,13 @@ namespace gr {
         "", "Var. clock cycles in call to work", RPC_PRIVLVL_MIN,
         DISPTIME | DISPOPTSTRIP)));
 
+    d_rpc_vars.push_back(
+      rpcbasic_sptr(new rpcbasic_register_get<block, float>(
+        alias(), "total work time", &block::pc_work_time_total,
+        pmt::mp(0), pmt::mp(1e9), pmt::mp(0),
+        "", "Total clock cycles in calls to work", RPC_PRIVLVL_MIN,
+        DISPTIME | DISPOPTSTRIP)));
+
     d_rpc_vars.push_back(
       rpcbasic_sptr(new rpcbasic_register_get<block, std::vector<float> >(
         alias(), "input \% full", &block::pc_input_buffers_full,
-- 
cgit v1.2.3