Hello community, here is the log from the commit of package powerstat for openSUSE:Factory checked in at 2018-06-07 19:56:40 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/powerstat (Old) and /work/SRC/openSUSE:Factory/.powerstat.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "powerstat" Thu Jun 7 19:56:40 2018 rev:5 rq:614061 version:0.02.17 Changes: -------- --- /work/SRC/openSUSE:Factory/powerstat/powerstat.changes 2018-02-06 16:51:27.493596345 +0100 +++ /work/SRC/openSUSE:Factory/.powerstat.new/powerstat.changes 2018-06-07 19:56:44.447576233 +0200 @@ -1,0 +2,23 @@ +Fri Jun 1 19:51:51 UTC 2018 - mardnh@gmx.de + +- Update to version 0.02.17 + * Makefile: bump version + * voidify returns from log_printf call + * Make indices arrays const + * Make cpu_freq_scale const + * Add hint on how to run if not in "discharge" mode + * Add adjustable C-state column width for C-state name column + * snapcraft: make confinement strict + * snapcraft: add plugs + +------------------------------------------------------------------- +Sat May 19 08:40:36 UTC 2018 - mardnh@gmx.de + +- update to version 0.02.16 + * Makefile: bump version + * debian/copyright: use secure https url + * debian/control: remove empty last line + * update debian/compat to 11 + * Fix range of CPU frequencies histogram. Scale by 1000 and not 1e9 + +------------------------------------------------------------------- Old: ---- powerstat-0.02.15.tar.gz New: ---- powerstat-0.02.17.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ powerstat.spec ++++++ --- /var/tmp/diff_new_pack.6aqFe6/_old 2018-06-07 19:56:45.691530658 +0200 +++ /var/tmp/diff_new_pack.6aqFe6/_new 2018-06-07 19:56:45.695530512 +0200 @@ -18,14 +18,13 @@ Name: powerstat -Version: 0.02.15 +Version: 0.02.17 Release: 0 Summary: Laptop power measuring tool -License: GPL-2.0 +License: GPL-2.0-only Group: System/Monitoring -Url: http://kernel.ubuntu.com/~cking/powerstat/ +URL: http://kernel.ubuntu.com/~cking/powerstat/ Source: http://kernel.ubuntu.com/~cking/tarballs/%{name}/%{name}-%{version}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-build %description Powerstat measures the power consumption of a mobile PC that has a battery @@ -44,9 +43,8 @@ %make_install %files -%defattr(-,root,root) -%doc COPYING +%license COPYING %{_bindir}/powerstat -%{_mandir}/man8/powerstat.8%{ext_man} +%{_mandir}/man8/powerstat.8%{?ext_man} %changelog ++++++ powerstat-0.02.15.tar.gz -> powerstat-0.02.17.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.15/Makefile new/powerstat-0.02.17/Makefile --- old/powerstat-0.02.15/Makefile 2018-01-31 12:33:29.000000000 +0100 +++ new/powerstat-0.02.17/Makefile 2018-05-29 14:05:46.000000000 +0200 @@ -16,7 +16,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # -VERSION=0.02.15 +VERSION=0.02.17 CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.15/powerstat.c new/powerstat-0.02.17/powerstat.c --- old/powerstat-0.02.15/powerstat.c 2018-01-31 12:33:29.000000000 +0100 +++ new/powerstat-0.02.17/powerstat.c 2018-05-29 14:05:46.000000000 +0200 @@ -155,7 +155,8 @@ char *suffix; } cpu_freq_scale_t; -static cpu_freq_scale_t cpu_freq_scale[] = { +/* Different freq scaling rates */ +static const cpu_freq_scale_t cpu_freq_scale[] = { { 1e1, 1e0, "Hz" }, { 1e4, 1e3, "KHz" }, { 1e7, 1e6, "MHz" }, @@ -796,7 +797,7 @@ char buf[4096]; int i, j; - static stat_type indices[] = { + static const stat_type indices[] = { CPU_USER, CPU_NICE, CPU_SYS, CPU_IDLE, CPU_IOWAIT, CPU_IRQ, CPU_SOFTIRQ, CPU_CTXT, CPU_INTR, CPU_PROCS_RUN, CPU_PROCS_BLK, -1 @@ -894,7 +895,7 @@ int i, j; bool inaccurate = false; - static int indices[] = { + static const int indices[] = { CPU_USER, CPU_NICE, CPU_SYS, CPU_IDLE, CPU_IOWAIT, -1 }; @@ -1462,6 +1463,11 @@ return 0; } (void)printf("Device is not discharging, cannot measure power usage.\n"); + (void)printf("Perhaps re-run with -z (ignore zero power)" +#if defined(POWERSTAT_X86) + " or -R (RAPL)" +#endif + "\n"); return -1; } @@ -2309,6 +2315,7 @@ cpu_state_t *s; double c0_percent = 100.0; bool c0 = false; + int name_width = 10; if (!cpu_states_list) return; @@ -2317,6 +2324,10 @@ cpu_info_t *ci; uint64_t state_total = 0; double time_total = 0; + const int len = strlen(s->name); + + if (len > name_width) + name_width = len; for (ci = s->cpu_info_list; ci; ci = ci->list_next) { state_total += ci->time_diff; @@ -2333,13 +2344,13 @@ } if (c0_percent >= 0.0) { - (void)printf("\n%-10s %7s %10s %-8s\n", - "C-State", "Resident", "Count", "Latency"); + (void)printf("\n%-*s %7s %10s %-8s\n", + name_width, "C-State", "Resident", "Count", "Latency"); for (s = cpu_states_list; s; s = s->list_next) - (void)printf("%-10s %7.3f%% %10" PRIu64 "%8" PRIu64 "\n", - s->name, s->resident, s->usage_total, s->latency); + (void)printf("%-*s %7.3f%% %10" PRIu64 "%8" PRIu64 "\n", + name_width, s->name, s->resident, s->usage_total, s->latency); if (!c0) - (void)printf("%-10s %7.3f%%\n", "C0", c0_percent); + (void)printf("%-*s %7.3f%%\n", name_width, "C0", c0_percent); } else { (void)printf("\nUntrustworthy C-State states, ignoring.\n"); } @@ -2717,7 +2728,7 @@ proc_info_add(proc_ev->event_data.fork.child_pid); if (opts & OPTS_SHOW_PROC_ACTIVITY) { char *type = is_thread ? "clone" : "fork"; - log_printf("fork: parent pid=%d -> %s pid=%d (%s)\n", + (void)log_printf("fork: parent pid=%d -> %s pid=%d (%s)\n", ppid, type, proc_ev->event_data.fork.child_pid, @@ -2728,7 +2739,7 @@ case PROC_EVENT_EXEC: stats[readings].value[PROC_EXEC] += 1.0; if (opts & OPTS_SHOW_PROC_ACTIVITY) { - log_printf("exec: pid=%d (%s)\n", + (void)log_printf("exec: pid=%d (%s)\n", proc_ev->event_data.exec.process_tgid, proc_info_get(proc_ev->event_data.exec.process_pid)); } @@ -2737,7 +2748,7 @@ case PROC_EVENT_EXIT: stats[readings].value[PROC_EXIT] += 1.0; if (opts & OPTS_SHOW_PROC_ACTIVITY) { - log_printf("exit: pid=%d exit_code=%d (%s)\n", + (void)log_printf("exit: pid=%d exit_code=%d (%s)\n", proc_ev->event_data.exit.process_pid, proc_ev->event_data.exit.exit_code, proc_info_get(proc_ev->event_data.exit.process_pid)); @@ -2837,7 +2848,7 @@ stats_histogram(stats, readings, CPU_FREQ, "CPU average frequencies", "Histogram (of %d CPU average frequencies)\n\n", - "Range (GHz)", 1e9); + "Range (GHz)", 1000.0); if (opts & OPTS_THERMAL_ZONE) { uint8_t tz; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/powerstat-0.02.15/snapcraft/snapcraft.yaml new/powerstat-0.02.17/snapcraft/snapcraft.yaml --- old/powerstat-0.02.15/snapcraft/snapcraft.yaml 2018-01-31 12:33:29.000000000 +0100 +++ new/powerstat-0.02.17/snapcraft/snapcraft.yaml 2018-05-29 14:05:46.000000000 +0200 @@ -1,8 +1,8 @@ name: powerstat -version: 0.02.11-20170425-290-5bd6c38 +version: 0.02.16-20180521-322-c35510c summary: computer power measuring tool description: Powerstat measures the power consumption of a computer that has a battery power source or an Intel RAPL power domain. 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. -confinement: devmode +confinement: strict type: app grade: stable @@ -17,4 +17,5 @@ apps: powerstat: command: usr/bin/powerstat + plugs: [hardware-observe,netlink-connector,system-observe]