Hello community,

here is the log from the commit of package eventstat for openSUSE:Factory 
checked in at 2017-05-18 20:50:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/eventstat (Old)
 and      /work/SRC/openSUSE:Factory/.eventstat.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "eventstat"

Thu May 18 20:50:24 2017 rev:2 rq:495697 version:0.03.04

Changes:
--------
--- /work/SRC/openSUSE:Factory/eventstat/eventstat.changes      2016-09-21 
18:46:42.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.eventstat.new/eventstat.changes 2017-05-18 
20:50:29.676847974 +0200
@@ -1,0 +2,24 @@
+Wed May 10 14:40:35 UTC 2017 - mar...@gmx.de
+
+- update to version 0.03.04
+  * Makefile: bump version
+  * Add GNU C printf attribute to err_abort
+  * Makefile: add snapcraft files to make dist rule
+  * Add variable pid size handling.
+  * Add snapcraft files
+  * Update copyright year
+  * Fix non-ANSI declaration of functions eventstat_winsize
+    and eventstat_refresh
+
+- update to version 0.03.03
+  * Makefile: bump version
+  * Fix FLOAT_CMP macro - need fabs on result
+  * Remove sdl declarations to fix sdl shadowing
+  * constify info1, info2
+  * Move scope of duration, removes shadowing of this variable
+  * Allow floating point comparisons a little bit of tiny slop
+  * Add stdarg.h header
+  * use gnu printf style attributes for es_printf
+  * Makefile: add PEDANTIC flags
+
+-------------------------------------------------------------------

Old:
----
  eventstat-0.03.02.tar.gz

New:
----
  eventstat-0.03.04.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ eventstat.spec ++++++
--- /var/tmp/diff_new_pack.lpVUzY/_old  2017-05-18 20:50:30.544725493 +0200
+++ /var/tmp/diff_new_pack.lpVUzY/_new  2017-05-18 20:50:30.544725493 +0200
@@ -1,7 +1,8 @@
 #
 # spec file for package eventstat
 #
-# Copyright (c) 2016, Martin Hauke <mar...@gmx.de>
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017, Martin Hauke <mar...@gmx.de>
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,7 +18,7 @@
 
 
 Name:           eventstat
-Version:        0.03.02
+Version:        0.03.04
 Release:        0
 Summary:        Kernel event states monitoring tool
 License:        GPL-2.0+
@@ -47,6 +48,6 @@
 %defattr(-,root,root)
 %doc COPYING
 %{_bindir}/eventstat
-%{_mandir}/man8/*
+%{_mandir}/man8/eventstat.8%{ext_man}
 
 %changelog

++++++ eventstat-0.03.02.tar.gz -> eventstat-0.03.04.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/eventstat-0.03.02/Makefile 
new/eventstat-0.03.04/Makefile
--- old/eventstat-0.03.02/Makefile      2016-05-05 14:20:21.000000000 +0200
+++ new/eventstat-0.03.04/Makefile      2017-04-14 17:41:53.000000000 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2011-2016 Canonical, Ltd.
+# Copyright (C) 2011-2017 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,10 +16,20 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
 #
 
-VERSION=0.03.02
+VERSION=0.03.04
 
 CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' -O2
 
+#
+# Pedantic flags
+#
+ifeq ($(PEDANTIC),1)
+CFLAGS += -Wabi -Wcast-qual -Wfloat-equal -Wmissing-declarations \
+       -Wmissing-format-attribute -Wno-long-long -Wpacked \
+       -Wredundant-decls -Wshadow -Wno-missing-field-initializers \
+       -Wno-missing-braces -Wno-sign-compare -Wno-multichar
+endif
+
 BINDIR=/usr/bin
 MANDIR=/usr/share/man/man8
 
@@ -32,7 +42,8 @@
 dist:
        rm -rf eventstat-$(VERSION)
        mkdir eventstat-$(VERSION)
-       cp -rp Makefile eventstat.c eventstat.8 COPYING eventstat-$(VERSION)
+       cp -rp Makefile eventstat.c eventstat.8 COPYING snapcraft \
+               eventstat-$(VERSION)
        tar -zcf eventstat-$(VERSION).tar.gz eventstat-$(VERSION)
        rm -rf eventstat-$(VERSION)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/eventstat-0.03.02/eventstat.c 
new/eventstat-0.03.04/eventstat.c
--- old/eventstat-0.03.02/eventstat.c   2016-05-05 14:20:21.000000000 +0200
+++ new/eventstat-0.03.04/eventstat.c   2017-04-14 17:41:53.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2016 Canonical
+ * Copyright (C) 2011-2017 Canonical
  * Hugely modified parts from powertop-1.13, Copyright 2007, Intel Corporation
  *
  * This program is free software; you can redistribute it and/or
@@ -23,6 +23,7 @@
 #include <stdlib.h>
 #include <stdbool.h>
 #include <string.h>
+#include <stdarg.h>
 #include <stdint.h>
 #include <inttypes.h>
 #include <signal.h>
@@ -90,6 +91,9 @@
 #define OPTIMIZE3
 #endif
 
+#define FLOAT_TINY             (0.0000001)
+#define FLOAT_CMP(a, b)                (fabs(a - b) < FLOAT_TINY)
+
 typedef struct timer_info {
        struct timer_info *next;        /* Next in list */
        struct timer_info *hash_next;   /* Next in hash list */
@@ -142,6 +146,8 @@
 static const char *app_name = "eventstat";
 static const char *proc_timer_stats = "/proc/timer_stats";
 
+static void es_printf(const char *fmt, ...) __attribute__((format(printf, 1, 
2)));
+
 static timer_stat_t *timer_stat_free_list; /* free list of timer stats */
 static timer_info_t *timer_info_list;  /* cache list of timer_info */
 static timer_info_t *timer_info_hash[TABLE_SIZE]; /* hash of timer_info */
@@ -212,6 +218,42 @@
 };
 
 /*
+ *  pid_max_digits()
+ *     determine (or guess) maximum digits of pids
+ */
+static int pid_max_digits(void)
+{
+       static int max_digits;
+       ssize_t n;
+       int fd;
+       const int default_digits = 6;
+       const int min_digits = 5;
+       char buf[32];
+
+       if (max_digits)
+               goto ret;
+
+       max_digits = default_digits;
+       fd = open("/proc/sys/kernel/pid_max", O_RDONLY);
+       if (fd < 0)
+               goto ret;
+       n = read(fd, buf, sizeof(buf) - 1);
+       (void)close(fd);
+       if (n < 0)
+               goto ret;
+
+       buf[n] = '\0';
+       max_digits = 0;
+       while (buf[max_digits] >= '0' && buf[max_digits] <= '9')
+               max_digits++;
+       if (max_digits < min_digits)
+               max_digits = min_digits;
+ret:
+       return max_digits;
+
+}
+
+/*
  *  hash_djb2a()
  *     Hash a string, from Dan Bernstein comp.lang.c (xor version)
  */
@@ -223,6 +265,7 @@
        while ((c = *str++)) {
                /* (hash * 33) ^ c */
                hash = ((hash << 5) + hash) ^ c;
+               hash = (hash * 33) ^ c;
        }
        return hash % TABLE_SIZE;
 }
@@ -231,7 +274,7 @@
  *  eventstat_winsize()
  *     get tty size
  */
-static void eventstat_winsize()
+static void eventstat_winsize(void)
 {
        struct winsize ws;
 
@@ -256,7 +299,7 @@
  *  eventstat_refresh()
  *     refresh screen if in top mode
  */
-static inline void eventstat_refresh()
+static inline void eventstat_refresh(void)
 {
        if (curses_init)
                refresh();
@@ -290,7 +333,8 @@
  *  err_abort()
  *     print an error and exit
  */
-static void __attribute__ ((noreturn)) err_abort(const char *fmt, ...)
+static void __attribute__ ((noreturn)) __attribute__((format(printf, 1, 2)))
+err_abort(const char *fmt, ...)
 {
        va_list ap;
 
@@ -467,7 +511,7 @@
                return;
 
        for (sdl = sample_delta_list; sdl; sdl = sdl->next) {
-               if (sdl->whence == whence) {
+               if (FLOAT_CMP(sdl->whence, whence)) {
                        found = true;
                        break;
                }
@@ -519,8 +563,8 @@
  */
 static int info_compare_total(const void *item1, const void *item2)
 {
-       timer_info_t **info1 = (timer_info_t **)item1;
-       timer_info_t **info2 = (timer_info_t **)item2;
+       timer_info_t *const *info1 = (timer_info_t *const *)item1;
+       timer_info_t *const *info2 = (timer_info_t *const *)item2;
 
        if ((*info2)->total == (*info1)->total)
                return 0;
@@ -661,7 +705,6 @@
        FILE *fp;
        uint64_t count = 0;
        double first_time = -1.0;
-       double duration;
        timer_info_t *info;
        sample_delta_list_t *sdl;
 
@@ -735,8 +778,8 @@
                         *  raw sample count by scaling by 1.0 (i.e. no scaling)
                         */
                        if (sdi) {
-                               duration = duration_round((opt_flags & 
OPT_SAMPLE_COUNT) ? 1.0 : sdi->time_delta);
-                               fprintf(fp, ",%f", duration == 0.0 ? 0.0 :
+                               double duration = duration_round((opt_flags & 
OPT_SAMPLE_COUNT) ? 1.0 : sdi->time_delta);
+                               fprintf(fp, ",%f", FLOAT_CMP(duration, 0.0) ? 
0.0 :
                                        (double)sdi->delta / duration);
                        } else
                                fprintf(fp, ",%f", 0.0);
@@ -751,7 +794,6 @@
                fprintf(fp, ",Min:");
                for (i = 0; i < n; i++) {
                        double min = DBL_MAX;
-                       sample_delta_list_t *sdl;
 
                        for (sdl = sample_delta_list; sdl; sdl = sdl->next) {
                                sample_delta_item_t *sdi =
@@ -759,7 +801,7 @@
 
                                if (sdi) {
                                        double duration = 
duration_round((opt_flags & OPT_SAMPLE_COUNT) ? 1.0 : sdi->time_delta);
-                                       double val = (duration == 0.0) ?
+                                       double val = FLOAT_CMP(duration, 0.0) ?
                                                0.0 : sdi->delta / duration;
                                        if (min > val)
                                                min = val;
@@ -772,7 +814,6 @@
                fprintf(fp, ",Max:");
                for (i = 0; i < n; i++) {
                        double max = DBL_MIN;
-                       sample_delta_list_t *sdl;
 
                        for (sdl = sample_delta_list; sdl; sdl= sdl->next) {
                                sample_delta_item_t *sdi =
@@ -780,7 +821,7 @@
 
                                if (sdi) {
                                        double duration = 
duration_round((opt_flags & OPT_SAMPLE_COUNT) ? 1.0 : sdi->time_delta);
-                                       double val = (duration == 0.0) ?
+                                       double val = FLOAT_CMP(duration, 0.0) ?
                                                0.0 : sdi->delta / duration;
                                        if (max < val)
                                                max = val;
@@ -804,14 +845,13 @@
                        double average = (double)
                                sorted_timer_infos[i]->total / (double)count;
                        double sum = 0.0;
-                       sample_delta_list_t *sdl;
 
                        for (sdl = sample_delta_list; sdl; sdl = sdl->next) {
                                sample_delta_item_t *sdi =
                                        sample_find(sdl, sorted_timer_infos[i]);
                                if (sdi) {
                                        double duration = 
duration_round((opt_flags & OPT_SAMPLE_COUNT) ? 1.0 : sdi->time_delta);
-                                       double diff = duration == 0.0 ? 0.0 :
+                                       double diff = FLOAT_CMP(duration, 0.0) 
? 0.0 :
                                                ((double)sdi->delta - average) 
/ duration;
                                        diff = diff * diff;
                                        sum += diff;
@@ -1209,6 +1249,7 @@
        if (!(opt_flags & OPT_QUIET)) {
                uint64_t total = 0UL, kt_total = 0UL;
                int32_t j = 0;
+               const int pid_size = pid_max_digits();
                int sz, ta_size, if_size, cb_size;
 
                eventstat_winsize();
@@ -1224,13 +1265,14 @@
 
                ta_size = TASK_WIDTH + sz;
                if_size = FUNC_WIDTH + (3 * sz);
-               cb_size = cols - (8 + 1 + 5 + 1 + ta_size + 1 + if_size + 2);
+               cb_size = cols - (8 + 1 + pid_size + 1 + ta_size + 1 + if_size 
+ 2);
                if (cb_size < 0)
                        cb_size = 20;
 
-               es_printf("%8s %-5s %-*.*s",
+               es_printf("%8s %-*.*s %-*.*s",
                        (opt_flags & OPT_CUMULATIVE) ?
-                               "Events" : "Event/s", "PID",
+                               "Events" : "Event/s",
+                               pid_size, pid_size, "PID",
                                ta_size, ta_size, "Task");
                if (!(opt_flags & OPT_BRIEF))
                        es_printf(" %-*.*s %-*.*s\n",
@@ -1256,11 +1298,11 @@
 
                                if (opt_flags & OPT_BRIEF) {
 
-                                       es_printf("%5d %s\n",
-                                               sorted->info->pid, task);
+                                       es_printf("%*d %s\n",
+                                               pid_size, sorted->info->pid, 
task);
                                } else {
-                                       es_printf("%5d %-*.*s %-*.*s %-*.*s\n",
-                                               sorted->info->pid,
+                                       es_printf("%*d %-*.*s %-*.*s %-*.*s\n",
+                                               pid_size, sorted->info->pid,
                                                ta_size, ta_size, task,
                                                if_size, if_size, 
sorted->info->func,
                                                cb_size, cb_size, 
sorted->info->callback);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/eventstat-0.03.02/snapcraft/Makefile 
new/eventstat-0.03.04/snapcraft/Makefile
--- old/eventstat-0.03.02/snapcraft/Makefile    1970-01-01 01:00:00.000000000 
+0100
+++ new/eventstat-0.03.04/snapcraft/Makefile    2017-04-14 17:41:53.000000000 
+0200
@@ -0,0 +1,18 @@
+VERSION=$(shell git tag | tail -1 | cut -c2-)
+COMMITS=$(shell git log --oneline | wc -l)
+SHA=$(shell git log -1 --oneline | cut -d' ' -f1)
+DATE=$(shell date +'%Y%m%d')
+V=$(VERSION)-$(DATE)-$(COMMITS)-$(SHA)
+
+all: set_version
+       snapcraft
+
+set_version:
+       cat snapcraft.yaml | sed 's/version: .*/version: $(V)/' > 
snapcraft-tmp.yaml
+       mv snapcraft-tmp.yaml snapcraft.yaml
+
+clean:
+       rm -rf setup *.snap
+       snapcraft clean
+       cat snapcraft.yaml | sed 's/version: .*/version: 0/' > 
snapcraft-tmp.yaml
+       mv snapcraft-tmp.yaml snapcraft.yaml
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/eventstat-0.03.02/snapcraft/snapcraft.yaml 
new/eventstat-0.03.04/snapcraft/snapcraft.yaml
--- old/eventstat-0.03.02/snapcraft/snapcraft.yaml      1970-01-01 
01:00:00.000000000 +0100
+++ new/eventstat-0.03.04/snapcraft/snapcraft.yaml      2017-04-14 
17:41:53.000000000 +0200
@@ -0,0 +1,19 @@
+name: eventstat
+version: 0.03.3-20161115-254-9585650
+summary: kernel event states monitoring tool
+description:  Eventstat periodically dumps out the current kernel event state. 
 It keeps track of current events and outputs the change in events on each 
output update.  The tool requires sudo to run since it needs to write to 
/proc/timer_stats to start and stop the event monitoring.
+
+confinement: strict
+
+parts:
+    eventstat:
+        plugin: make
+        source: git://kernel.ubuntu.com/cking/eventstat
+        build-packages:
+            - gcc
+            - make
+
+apps:
+    eventstat:
+        command: usr/bin/eventstat
+


Reply via email to