Hello community,
here is the log from the commit of package powerstat for openSUSE:Factory checked in at 2018-02-06 16:51:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/powerstat (Old)
and /work/SRC/openSUSE:Factory/.powerstat.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "powerstat"
Tue Feb 6 16:51:15 2018 rev:4 rq:573309 version:0.02.15
Changes:
--------
--- /work/SRC/openSUSE:Factory/powerstat/powerstat.changes 2017-10-30 21:19:02.573979725 +0100
+++ /work/SRC/openSUSE:Factory/.powerstat.new/powerstat.changes 2018-02-06 16:51:27.493596345 +0100
@@ -1,0 +2,16 @@
+Wed Jan 31 19:26:59 UTC 2018 - mardnh@gmx.de
+
+- update to version 0.02.15
+ * Makefile: bump version
+ * Fix spelling mistake in comment
+ * Update copyright year
+ * Add GNU format attribute to log_printf
+
+-------------------------------------------------------------------
+Wed Nov 1 09:31:35 UTC 2017 - mardnh@gmx.de
+
+- update to version 0.02.14
+ * Makefile: bump version
+ * Add geometic mean to statistics
+
+-------------------------------------------------------------------
Old:
----
powerstat-0.02.13.tar.gz
New:
----
powerstat-0.02.15.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ powerstat.spec ++++++
--- /var/tmp/diff_new_pack.FALYro/_old 2018-02-06 16:51:28.361555699 +0100
+++ /var/tmp/diff_new_pack.FALYro/_new 2018-02-06 16:51:28.365555513 +0100
@@ -1,7 +1,7 @@
#
# spec file for package powerstat
#
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017, Martin Hauke
#
# All modifications and additions to the file contributed by third parties
@@ -18,7 +18,7 @@
Name: powerstat
-Version: 0.02.13
+Version: 0.02.15
Release: 0
Summary: Laptop power measuring tool
License: GPL-2.0
++++++ powerstat-0.02.13.tar.gz -> powerstat-0.02.15.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.13/Makefile new/powerstat-0.02.15/Makefile
--- old/powerstat-0.02.13/Makefile 2017-10-19 10:07:38.000000000 +0200
+++ new/powerstat-0.02.15/Makefile 2018-01-31 12:33:29.000000000 +0100
@@ -1,5 +1,5 @@
#
-# Copyright (C) 2011-2017 Canonical, Ltd.
+# Copyright (C) 2011-2018 Canonical, Ltd.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@@ -16,7 +16,7 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-VERSION=0.02.13
+VERSION=0.02.15
CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.13/powerstat.8 new/powerstat-0.02.15/powerstat.8
--- old/powerstat-0.02.13/powerstat.8 2017-10-19 10:07:38.000000000 +0200
+++ new/powerstat-0.02.15/powerstat.8 2018-01-31 12:33:29.000000000 +0100
@@ -2,7 +2,7 @@
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
-.TH POWERSTAT 8 "16 August, 2015"
+.TH POWERSTAT 8 "25 October 2017"
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
@@ -30,7 +30,8 @@
that has a battery power source or supports the RAPL (Running Average Power
Limit) interface. The output is like vmstat but also shows power
consumption statistics. At the end of a run, powerstat will calculate
-the average, standard deviation and min/max of the gathered data.
+the average, standard deviation, minimum, maximum and geometic mean of
+the gathered data.
.br
Note that running powerstat as root will provide extra information about
@@ -162,7 +163,7 @@
This manual page was written by Colin King ,
for the Ubuntu project (but may be used by others).
.SH COPYRIGHT
-Copyright \(co 2011-2016 Canonical Ltd.
+Copyright \(co 2011-2018 Canonical Ltd.
.br
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.13/powerstat.c new/powerstat-0.02.15/powerstat.c
--- old/powerstat-0.02.13/powerstat.c 2017-10-19 10:07:38.000000000 +0200
+++ new/powerstat-0.02.15/powerstat.c 2018-01-31 12:33:29.000000000 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011-2017 Canonical
+ * Copyright (C) 2011-2018 Canonical
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -333,7 +333,7 @@
/*
* set_prioity
- * set high priority to try and get netlink activty
+ * set high priority to try and get netlink activity
* before short lived processes die
*/
static void set_priority(void)
@@ -410,11 +410,12 @@
{
static char buffer[40];
char *suffix = "EHz";
+ const double f = freq * 1000000.0; /* MHz to Hz */
double scale = 1e18;
size_t i;
for (i = 0; cpu_freq_scale[i].suffix; i++) {
- if (freq < cpu_freq_scale[i].threshold) {
+ if (f < cpu_freq_scale[i].threshold) {
suffix = cpu_freq_scale[i].suffix;
scale = cpu_freq_scale[i].scale;
break;
@@ -422,7 +423,7 @@
}
(void)snprintf(buffer, sizeof(buffer), "%5.2f %-3s",
- freq / scale, suffix);
+ f / scale, suffix);
return buffer;
}
@@ -565,6 +566,8 @@
infolog.tail = NULL;
}
+static int log_printf(const char *const fmt, ...) __attribute__((format(printf, 1, 2)));
+
/*
* log_printf()
* append log messages in log list
@@ -768,7 +771,7 @@
"/sys/devices/system/cpu/%s/cpufreq/scaling_cur_freq",
name);
if (file_get_uint64(path, &freq) == 0) {
- total_freq += (double)freq * 1000.0;
+ total_freq += (double)freq / 1000.0; /* In MHz */
n++;
}
}
@@ -1097,7 +1100,8 @@
stats_t *const average,
stats_t *const stddev,
stats_t *const min,
- stats_t *const max)
+ stats_t *const max,
+ stats_t *const geometric_mean)
{
int i, j, valid;
@@ -1106,6 +1110,7 @@
max->value[j] = -DBL_MAX;
min->value[j] = DBL_MAX;
+ geometric_mean->value[j] = 1.0;
for (valid = 0, i = 0; i < num; i++) {
if (!stats[i].inaccurate[j]) {
@@ -1114,6 +1119,7 @@
if (stats[i].value[j] < min->value[j])
min->value[j] = stats[i].value[j];
total += stats[i].value[j];
+ geometric_mean->value[j] *= stats[i].value[j];
valid++;
}
}
@@ -1130,6 +1136,9 @@
}
stddev->value[j] = total / (double)num;
stddev->value[j] = sqrt(stddev->value[j]);
+
+ geometric_mean->value[j] = (num == 0) ? 0.0 :
+ pow(geometric_mean->value[j], 1.0 / (double)num);
} else {
average->inaccurate[j] = true;
max->inaccurate[j] = true;
@@ -1140,6 +1149,7 @@
max->value[j] = 0.0;
min->value[j] = 0.0;
stddev->value[j] = 0.0;
+ geometric_mean->value[j] = 0.0;
}
}
}
@@ -2517,7 +2527,7 @@
int64_t t = 1;
int redone = 0, row = 0;
uint32_t readings = 0;
- stats_t *stats, s1, s2, average, stddev, min, max;
+ stats_t *stats, s1, s2, average, stddev, min, max, geometric_mean;
struct nlmsghdr *nlmsghdr;
double time_start;
@@ -2531,6 +2541,7 @@
stats_clear(&stddev);
stats_clear(&min);
stats_clear(&max);
+ stats_clear(&geometric_mean);
stats_headings();
row++;
@@ -2760,10 +2771,11 @@
* min and max and display
*/
stats_average_stddev_min_max(stats, readings, &average,
- &stddev, &min, &max);
+ &stddev, &min, &max, &geometric_mean);
if (readings > 0) {
stats_ruler();
stats_print("Average", true, &average);
+ stats_print("GeoMean", true, &geometric_mean);
stats_print("StdDev", true, &stddev);
stats_ruler();
stats_print("Minimum", true, &min);