From 517fcf45f5f78c2cdd2ea1739fc6fc87f22cedc4 Mon Sep 17 00:00:00 2001 From: Manuel Penschuck Date: Tue, 4 Nov 2014 16:32:04 +0100 Subject: [PATCH] Total Dead Counter in CTS --- web/CtsPlugins/CtsModStatic.pm | 13 +++++++++++++ web/htdocs/cts/cts.htm | 6 ++++++ web/htdocs/scripts/cts.js | 5 +++++ 3 files changed, 24 insertions(+) diff --git a/web/CtsPlugins/CtsModStatic.pm b/web/CtsPlugins/CtsModStatic.pm index ed0d6a5..d87195f 100755 --- a/web/CtsPlugins/CtsModStatic.pm +++ b/web/CtsPlugins/CtsModStatic.pm @@ -184,6 +184,19 @@ sub init { } } + if ($prop->{'trb_compiletime'} > 1415039170) { + eval { + $regs->{'cts_cnt_total_dead_time'} = TrbRegister->new(0x0e + $debug_block, $trb, {}, { + 'accessmode' => "ro", + 'label' => "Total Dead Time Counter", + 'monitorrate' => 1 + }); + $regs->{'cts_cnt_total_dead_time'}->read(); + 1; + } and do { + $prop->{'cts_cnt_total_dead_time'} = 1; + } + } } 1; diff --git a/web/htdocs/cts/cts.htm b/web/htdocs/cts/cts.htm index 2f4efd2..fa46640 100644 --- a/web/htdocs/cts/cts.htm +++ b/web/htdocs/cts/cts.htm @@ -72,6 +72,12 @@ n/a n/a + + + Total Dead Time + n/a + n/a +   diff --git a/web/htdocs/scripts/cts.js b/web/htdocs/scripts/cts.js index cebfd19..462ba07 100644 --- a/web/htdocs/scripts/cts.js +++ b/web/htdocs/scripts/cts.js @@ -105,6 +105,10 @@ var CTS = new Class({ this.initEventBuilderRR(); + if (!this.defs.properties.cts_cnt_total_dead_time) { + $('cnt_total_dead_time_row').destroy(); + } + this.initAutoCommit(); this.initSliceTitle(); }, @@ -836,6 +840,7 @@ function countToTime(val) {return (1.0*val / cts.defs.properties.cts_clock_frq * function countToFreq(val) {return formatFreq (1 / (val / cts.defs.properties.cts_clock_frq)); } function timeToCount(val) {return (parseNum(val) / 1.0e9 * cts.defs.properties.cts_clock_frq).round();} function rateToFrac(val) {return appendScalingPrefix(val) + 'cnt/s'} +function rateToRatio(val) {return (val / 1e6).toFixed(1) + '%';} function formatFreq(val, sigDigits) { return appendScalingPrefix(val, sigDigits) + "Hz"; -- 2.43.0