Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package eventstat for openSUSE:Factory 
checked in at 2021-05-12 19:32:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/eventstat (Old)
 and      /work/SRC/openSUSE:Factory/.eventstat.new.2988 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "eventstat"

Wed May 12 19:32:51 2021 rev:11 rq:892525 version:0.04.12

Changes:
--------
--- /work/SRC/openSUSE:Factory/eventstat/eventstat.changes      2020-11-12 
22:49:51.478797323 +0100
+++ /work/SRC/openSUSE:Factory/.eventstat.new.2988/eventstat.changes    
2021-05-12 19:33:32.734722824 +0200
@@ -1,0 +2,9 @@
+Thu Apr 29 11:47:22 UTC 2021 - Martin Hauke <mar...@gmx.de>
+
+- Update to version 0.04.12
+  * Rename clock_tick_rate to g_clock_tick_rate
+  * Make get_events_buf local
+- Update to version 0.04.11
+  * handle case where comm field contains ) and spaces
+
+-------------------------------------------------------------------

Old:
----
  eventstat-0.04.10.tar.gz

New:
----
  eventstat-0.04.12.tar.gz

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

Other differences:
------------------
++++++ eventstat.spec ++++++
--- /var/tmp/diff_new_pack.fx3fbI/_old  2021-05-12 19:33:33.070721481 +0200
+++ /var/tmp/diff_new_pack.fx3fbI/_new  2021-05-12 19:33:33.074721465 +0200
@@ -1,8 +1,8 @@
 #
 # spec file for package eventstat
 #
-# Copyright (c) 2020 SUSE LLC
-# Copyright (c) 2017-2020, Martin Hauke <mar...@gmx.de>
+# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2017-2021, 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
@@ -18,7 +18,7 @@
 
 
 Name:           eventstat
-Version:        0.04.10
+Version:        0.04.12
 Release:        0
 Summary:        Kernel event states monitoring tool
 License:        GPL-2.0-or-later

++++++ eventstat-0.04.10.tar.gz -> eventstat-0.04.12.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/eventstat-0.04.10/Makefile 
new/eventstat-0.04.12/Makefile
--- old/eventstat-0.04.10/Makefile      2020-07-04 11:51:43.000000000 +0200
+++ new/eventstat-0.04.12/Makefile      2021-04-29 10:27:38.000000000 +0200
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2011-2020 Canonical, Ltd.
+# Copyright (C) 2011-2021 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.04.10
+VERSION=0.04.12
 
 CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' -O2
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/eventstat-0.04.10/bash-completion/eventstat 
new/eventstat-0.04.12/bash-completion/eventstat
--- old/eventstat-0.04.10/bash-completion/eventstat     2020-07-04 
11:51:43.000000000 +0200
+++ new/eventstat-0.04.12/bash-completion/eventstat     2021-04-29 
10:27:38.000000000 +0200
@@ -1,6 +1,6 @@
 # eventstat tab completion for bash.
 #
-# Copyright (C) 2020 Canonical
+# Copyright (C) 2020-2021 Canonical
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/eventstat-0.04.10/eventstat.8 
new/eventstat-0.04.12/eventstat.8
--- old/eventstat-0.04.10/eventstat.8   2020-07-04 11:51:43.000000000 +0200
+++ new/eventstat-0.04.12/eventstat.8   2021-04-29 10:27:38.000000000 +0200
@@ -141,7 +141,7 @@
 This manual page was written by Colin King <colin.k...@canonical.com>,
 for the Ubuntu project (but may be used by others).
 .SH COPYRIGHT
-Copyright \(co 2011-2016 Canonical Ltd.
+Copyright \(co 2011-2021 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/eventstat-0.04.10/eventstat.c 
new/eventstat-0.04.12/eventstat.c
--- old/eventstat-0.04.10/eventstat.c   2020-07-04 11:51:43.000000000 +0200
+++ new/eventstat-0.04.12/eventstat.c   2021-04-29 10:27:38.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2020 Canonical
+ * Copyright (C) 2011-2021 Canonical
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -191,7 +191,6 @@
 static double g_opt_threshold;
 
 static char *g_csv_results;            /* results in comma separated values */
-static char *g_get_events_buf;         /* buffer to glob events into */
 static uint32_t g_timer_info_list_length; /* length of timer_info_list */
 static uint32_t g_opt_flags;           /* option flags */
 static volatile bool g_stop_eventstat = false; /* set by sighandler */
@@ -200,7 +199,7 @@
 static bool g_curses_init;             /* curses initialised */
 static int g_rows = 25;                        /* tty size, rows */
 static int g_cols = 80;                        /* tty size, columns */
-static uint64_t clock_tick_rate;       /* system clock tick rate */
+static uint64_t g_clock_tick_rate;     /* system clock tick rate */
 
 /*
  *  Attempt to catch a range of signals so
@@ -579,7 +578,7 @@
        uint16_t *rt_prio,
        int16_t *niceness)
 {
-       char buffer[4096], path[PATH_MAX], *ptr = buffer, *endptr;
+       char buffer[4096], path[PATH_MAX], *ptr = buffer, *endptr, *tmp;
        int fd, skip;
        uint64_t utime, stime;
        ssize_t len;
@@ -619,10 +618,10 @@
                return -1;
        ptr++;
        /* parse comm field */
-       while ((*ptr != '\0') && (*ptr !=')'))
-               ptr++;
-       if (UNLIKELY(*ptr != ')'))
-               return -1;
+       for (tmp = ptr; *tmp; tmp++) {
+               if (*tmp == ')')
+                       ptr = tmp;
+       }
        ptr++;
        if (UNLIKELY(*ptr != ' '))
                return -1;
@@ -1571,7 +1570,7 @@
                                        if (cpu_ticks && 
sorted->info->cpu_ticks) {
                                                uint64_t ticks = cpu_ticks - 
sorted->info->cpu_ticks;
 
-                                               cpu = (100.0 * (double)ticks) / 
(tick_time * (double)clock_tick_rate);
+                                               cpu = (100.0 * (double)ticks) / 
(tick_time * (double)g_clock_tick_rate);
                                        } else {
                                                cpu = 0.0;
                                        }
@@ -1636,15 +1635,15 @@
  *     only free'd at exit time.  This way we can parse
  *     the data a little faster.
  */
-static char *read_events(const double time_end)
+static char *read_events(const double time_end, char **get_events_buf)
 {
        int fd;
        static size_t get_events_size;
        size_t size;
 
-       if (UNLIKELY(g_get_events_buf == NULL)) {
-               g_get_events_buf = malloc(EVENT_BUF_SIZE << 1);
-               if (UNLIKELY(!g_get_events_buf)) {
+       if (UNLIKELY(*get_events_buf == NULL)) {
+               *get_events_buf = calloc(EVENT_BUF_SIZE << 1, sizeof(char));
+               if (UNLIKELY(!*get_events_buf)) {
                        err_abort("Cannot read %s, out of memory\n",
                                g_sys_tracing_pipe);
                }
@@ -1696,21 +1695,21 @@
                        char *tmpptr;
 
                        get_events_size += (EVENT_BUF_SIZE << 1);
-                       tmpptr = realloc(g_get_events_buf, get_events_size + 1);
+                       tmpptr = realloc(*get_events_buf, get_events_size + 1);
                        if (UNLIKELY(!tmpptr)) {
                                (void)close(fd);
                                err_abort("Cannot read %s, out of memory\n",
                                        g_sys_tracing_pipe);
                        }
-                       g_get_events_buf = tmpptr;
+                       *get_events_buf = tmpptr;
                }
-               (void)memcpy(g_get_events_buf + size, buffer, ret);
+               (void)memcpy((*get_events_buf) + size, buffer, ret);
                size += ret;
-               *(g_get_events_buf + size) = '\0';
+               *(*get_events_buf + size) = '\0';
        }
        (void)close(fd);
 
-       return g_get_events_buf;
+       return *get_events_buf;
 }
 
 /*
@@ -1720,13 +1719,15 @@
  */
 static void get_events(
        timer_stat_t *timer_stats[],
+       char **get_events_buf,
        const double time_now,
        const double duration)
 {
        const size_t app_name_len = strlen(g_app_name);
        const double time_end = time_now + duration - 0.05;
-       char *tmpptr = read_events(time_end);
+       char *tmpptr;
 
+       tmpptr = read_events(time_end, get_events_buf);
        if (!tmpptr)
                return;
 
@@ -1853,6 +1854,7 @@
 int main(int argc, char **argv)
 {
        timer_stat_t **timer_stats;
+       char *get_events_buf = NULL;
        double duration_secs = 1.0, time_start, time_now;
        int64_t count = 1, t = 1;
        int32_t n_lines = -1;
@@ -1979,7 +1981,7 @@
        set_tracing_enable("1\n", true);
        set_tracing_event();
 
-       clock_tick_rate = (uint64_t)sysconf(_SC_CLK_TCK);
+       g_clock_tick_rate = (uint64_t)sysconf(_SC_CLK_TCK);
        time_now = time_start = gettime_to_double();
 
        if (g_opt_flags & OPT_TOP) {
@@ -2048,7 +2050,7 @@
                        }
                }
 
-               get_events(timer_stats, time_now, secs);
+               get_events(timer_stats, &get_events_buf, time_now, secs);
 
                duration = gettime_to_double() - time_now;
                duration = floor((duration * 1000.0) + 0.5) / 1000.0;
@@ -2071,7 +2073,7 @@
        samples_free();
        timer_info_list_free();
        timer_stat_free_list_free();
-       free(g_get_events_buf);
+       free(get_events_buf);
 
        eventstat_exit(EXIT_SUCCESS);
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/eventstat-0.04.10/snap/snapcraft.yaml 
new/eventstat-0.04.12/snap/snapcraft.yaml
--- old/eventstat-0.04.10/snap/snapcraft.yaml   2020-07-04 11:51:43.000000000 
+0200
+++ new/eventstat-0.04.12/snap/snapcraft.yaml   2021-04-29 10:27:38.000000000 
+0200
@@ -1,17 +1,31 @@
 name: eventstat
-version: git
-version-script: |
-    echo $(git describe --tags)
 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
 type: app
 grade: stable
+assumes: [snapd2.45]
+base: core18
+adopt-info: eventstat
 
 parts:
     eventstat:
         plugin: make
         source: git://kernel.ubuntu.com/cking/eventstat
+        override-pull: |
+            snapcraftctl pull
+            description="$(git describe HEAD --tags)"
+            sha=$(echo $description | tr '-' ' ' | awk '{print $NF}')
+            version=${description%$sha}
+            commits=$(git log --oneline | wc -l)
+            date=$(date +'%Y%m%d')
+            if test "$description" = "$sha"
+            then
+                version="$description"
+            else
+                version=$(echo $version$date-$commits-$sha | cut -c1-32)
+            fi
+            snapcraftctl set-version "$version"
         build-packages:
             - gcc
             - make

Reply via email to