summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-04-25 10:08:51 +0200
committerDaniel Friesel <derf@finalrewind.org>2017-04-25 10:08:51 +0200
commitd5ee843dc7b061a3aed0f9d22615442f9228a28b (patch)
tree4942a98caffb4cf14bf23562b2fb6ade6669919c /lib
parentbc0bd155d03a8108badd441f8756739565fe300a (diff)
DFADriver: show warning in high-power state with probable energy counter overflow
Diffstat (limited to 'lib')
-rw-r--r--lib/Kratos/DFADriver.pm12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Kratos/DFADriver.pm b/lib/Kratos/DFADriver.pm
index 466cf64..b59dec1 100644
--- a/lib/Kratos/DFADriver.pm
+++ b/lib/Kratos/DFADriver.pm
@@ -192,6 +192,17 @@ sub printf_aggr {
}
}
+sub printf_counter_status {
+ my ($self, $hash, $key) = @_;
+
+ $hash = $hash->{$key};
+
+ if (2 ** 32 / $hash->{median} < 10e6) {
+ printf(" %s: 32bit energy counter will overflow after %.f ms\n",
+ 'power', (2 ** 32 / $hash->{median}) / 1000);
+ }
+}
+
sub printf_aggr_tex {
my ( $self, $hash, $key, $unit, $divisor) = @_;
@@ -481,6 +492,7 @@ sub assess_model {
$self->printf_clip($state);
$self->printf_aggr( $state, 'power', 'µW' );
+ $self->printf_counter_status( $state, 'power' );
$self->printf_parameterized( $state, 'power' );
$self->printf_fit( $state, 'power', 'µW' );
}