summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/lib/block.cc
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2013-09-06 13:25:43 -0400
committerTom Rondeau <tom@trondeau.com>2013-09-06 13:25:43 -0400
commite24e6d149ae6395c93d8c0df4d806e05971fc281 (patch)
tree41d5756a440cf35f0a1f8b2a30dbd434b8bd9faf /gnuradio-runtime/lib/block.cc
parent08ea1feffdd64cc492c68adcd7dab89166481dba (diff)
runtime: Added a Performance Counter that stores the accumulated work_time counter (work_time_total).
Diffstat (limited to 'gnuradio-runtime/lib/block.cc')
-rw-r--r--gnuradio-runtime/lib/block.cc18
1 files changed, 18 insertions, 0 deletions
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()
{
@@ -712,6 +723,13 @@ namespace gr {
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,
pmt::make_c32vector(0,0), pmt::make_c32vector(0,1), pmt::make_c32vector(0,0),