Hello community,

here is the log from the commit of package pagein for openSUSE:Factory checked 
in at 2020-03-06 21:28:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pagein (Old)
 and      /work/SRC/openSUSE:Factory/.pagein.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pagein"

Fri Mar  6 21:28:31 2020 rev:2 rq:782137 version:0.01.04

Changes:
--------
--- /work/SRC/openSUSE:Factory/pagein/pagein.changes    2018-06-04 
13:23:19.946857626 +0200
+++ /work/SRC/openSUSE:Factory/.pagein.new.26092/pagein.changes 2020-03-06 
21:28:31.845595687 +0100
@@ -1,0 +2,21 @@
+Fri Mar  6 14:26:30 UTC 2020 - Dominique Leuenberger <[email protected]>
+
+- Align SLEap builds with TW Builds.
+
+-------------------------------------------------------------------
+Fri Feb 28 09:51:29 UTC 2020 - Martin Hauke <[email protected]>
+
+- Supplement against bash-completion, not bash
+
+-------------------------------------------------------------------
+Thu Feb 27 21:04:01 UTC 2020 - Martin Hauke <[email protected]>
+
+- Update to version 0.01.04
+  * Add bash command completion script
+  * Remove kthreads stat, add in total mappings stat
+  * Add unreadable skipped pages stats
+  * Expand pid field to 6 digits
+  * Manual: change example to Xorg as a process to page in
+  * Remove defunct command options -d, -t, -w
+
+-------------------------------------------------------------------

Old:
----
  pagein-0.01.00.tar.gz

New:
----
  pagein-0.01.04.tar.gz

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

Other differences:
------------------
++++++ pagein.spec ++++++
--- /var/tmp/diff_new_pack.Vn92SY/_old  2020-03-06 21:28:32.673596197 +0100
+++ /var/tmp/diff_new_pack.Vn92SY/_new  2020-03-06 21:28:32.677596200 +0100
@@ -1,6 +1,7 @@
 #
 # spec file for package pagein
 #
+# Copyright (c) 2020 SUSE LLC
 # Copyright (c) 2018, Martin Hauke <[email protected]>
 #
 # All modifications and additions to the file contributed by third parties
@@ -12,30 +13,41 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           pagein
-Version:        0.01.00
+Version:        0.01.04
 Release:        0
 Summary:        A tool to force swapped out pages back into memory
 License:        GPL-2.0-only
 Group:          System/Monitoring
-URL:            http://kernel.ubuntu.com/~cking/pagein/
-Source:         
http://kernel.ubuntu.com/~cking/tarballs/%{name}/%{name}-%{version}.tar.gz
+URL:            https://kernel.ubuntu.com/~cking/pagein/
+Source:         
https://kernel.ubuntu.com/~cking/tarballs/%{name}/%{name}-%{version}.tar.gz
 
 %description
 Pagein is a tool that forces pages that are in swap to be paged in back
 to memory. The main usecase for pagein is to exercise the VM and swap
 subsystems for testing purposes.
 
+%package bash-completion
+Summary:        Bash Completion for %{name}
+Group:          System/Benchmark
+Requires:       %{name} = %{version}
+Requires:       bash-completion
+Supplements:    (pagein and bash-completion)
+BuildArch:      noarch
+
+%description bash-completion
+Bash completion script for %{name}.
+
 %prep
 %setup -q
 
 %build
 export CFLAGS="%{optflags}"
-make %{?_smp_mflags}
+%make_build
 
 %install
 %make_install
@@ -45,4 +57,7 @@
 %{_bindir}/pagein
 %{_mandir}/man1/pagein.1%{?ext_man}
 
+%files bash-completion
+%{_datadir}/bash-completion/completions/%{name}
+
 %changelog

++++++ pagein-0.01.00.tar.gz -> pagein-0.01.04.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pagein-0.01.00/.travis.yml 
new/pagein-0.01.04/.travis.yml
--- old/pagein-0.01.00/.travis.yml      1970-01-01 01:00:00.000000000 +0100
+++ new/pagein-0.01.04/.travis.yml      2020-02-26 15:09:26.000000000 +0100
@@ -0,0 +1,15 @@
+dist: bionic
+sudo: required
+
+matrix:
+    include:
+        - env: PEDANTIC=1
+
+before_install:
+    - sudo apt-get update -q
+    - sudo apt-get install build-essential
+
+language: c
+
+script:
+- make -j2 PEDANTIC=$PEDANTIC
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pagein-0.01.00/Makefile new/pagein-0.01.04/Makefile
--- old/pagein-0.01.00/Makefile 2018-01-14 17:22:01.000000000 +0100
+++ new/pagein-0.01.04/Makefile 2020-02-26 15:09:26.000000000 +0100
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016-2018 Canonical, Ltd.
+# Copyright (C) 2016-2020 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.01.00
+VERSION=0.01.04
 
 CFLAGS += -Wall -Wextra -DVERSION='"$(VERSION)"' -O2
 #
@@ -33,6 +33,7 @@
 
 BINDIR=/usr/bin
 MANDIR=/usr/share/man/man1
+BASHDIR=/usr/share/bash-completion/completions
 
 pagein: pagein.o
        $(CC) $(CPPFLAGS) $(CFLAGS) $< -o $@ $(LDFLAGS)
@@ -43,8 +44,8 @@
 dist:
        rm -rf pagein-$(VERSION)
        mkdir pagein-$(VERSION)
-       cp -rp Makefile pagein.c pagein.1 COPYING snapcraft \
-               pagein-$(VERSION)
+       cp -rp Makefile pagein.c pagein.1 COPYING snap .travis.yml \
+               bash-completion pagein-$(VERSION)
        tar -zcf pagein-$(VERSION).tar.gz pagein-$(VERSION)
        rm -rf pagein-$(VERSION)
 
@@ -57,3 +58,5 @@
        cp pagein ${DESTDIR}${BINDIR}
        mkdir -p ${DESTDIR}${MANDIR}
        cp pagein.1.gz ${DESTDIR}${MANDIR}
+       mkdir -p ${DESTDIR}${BASHDIR}
+       cp bash-completion/pagein ${DESTDIR}${BASHDIR}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pagein-0.01.00/bash-completion/pagein 
new/pagein-0.01.04/bash-completion/pagein
--- old/pagein-0.01.00/bash-completion/pagein   1970-01-01 01:00:00.000000000 
+0100
+++ new/pagein-0.01.04/bash-completion/pagein   2020-02-26 15:09:26.000000000 
+0100
@@ -0,0 +1,41 @@
+# pagein tab completion for bash.
+#
+# Copyright (C) 2020 Canonical
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 
USA.
+
+_pagein()
+{
+       local cur prev words cword
+       _init_completion || return
+
+       case "$prev" in
+        '-p')  COMPREPLY=( $(compgen -W '$(command ps axo pid | sed 1d) ' $cur 
) )
+               return 0
+               ;;
+       esac
+
+       case "$cur" in
+                -*)
+                        OPTS="-a -h -p -v"
+                        COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+                        return 0
+                        ;;
+        esac
+       return 0
+}
+
+# load the completion
+complete -F _pagein pagein
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pagein-0.01.00/pagein.1 new/pagein-0.01.04/pagein.1
--- old/pagein-0.01.00/pagein.1 2018-01-14 17:22:01.000000000 +0100
+++ new/pagein-0.01.04/pagein.1 2020-02-26 15:09:26.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 PAGEIN 1 "9 January, 2017"
+.TH PAGEIN 1 "16 June, 2017"
 .\" Please adjust this date whenever revising the manpage.
 .\"
 .\" Some roff macros, for reference:
@@ -58,9 +58,9 @@
 sudo pagein \-a \-v
 .RE
 .LP
-Page in the compiz process:
+Page in the Xorg process:
 .RS 8
-sudo pagein \-p $(pidof compiz)
+sudo pagein \-p $(pidof Xorg)
 .RE
 .SH SEE ALSO
 .BR free (1)
@@ -70,7 +70,7 @@
 This manual page was written by Colin King <[email protected]>,
 for the Ubuntu project (but may be used by others).
 .SH COPYRIGHT
-Copyright \(co 2016-2018 Canonical Ltd.
+Copyright \(co 2016-2019 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/pagein-0.01.00/pagein.c new/pagein-0.01.04/pagein.c
--- old/pagein-0.01.00/pagein.c 2018-01-14 17:22:01.000000000 +0100
+++ new/pagein-0.01.04/pagein.c 2020-02-26 15:09:26.000000000 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016-2018 Canonical, Ltd.
+ * Copyright (C) 2016-2020 Canonical, Ltd.
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
@@ -46,7 +46,6 @@
 #define OPT_VERBOSE            (0x00000001)
 #define OPT_ALL                        (0x00000002)
 #define OPT_BY_PID             (0x00000004)
-#define OPT_TOUCH_WRITEABLE    (0x00000008)
 
 #define GOT_MEMFREE            (0x01)
 #define GOT_SWAPFREE           (0x02)
@@ -155,8 +154,9 @@
        const int32_t page_size,
        const pid_t pid,
        int32_t *const procs,
-       int32_t *const kthreads,
-       int64_t *const total_pages_touched)
+       int64_t *const total_pages_touched,
+       int64_t *const total_pages_skipped,
+       int64_t *const total_mappings)
 {
        char path[PATH_MAX];
        char buffer[4096];
@@ -202,7 +202,12 @@
                if (sscanf(buffer, "%" SCNx64 "-%" SCNx64
                           " %5s %*x %*x:%*x %*d %1023s", &begin, &end, prot, 
tmppath) != 4)
                        continue;
+               (*total_mappings)++;
                len = end - begin;
+               if (prot[0] != 'r' && prot[3] != 'p') {
+                       *total_pages_skipped += (len / page_size);
+                       continue;
+               }
 
                if ((begin >= end) || (len == 0))
                        continue;
@@ -211,8 +216,17 @@
 
                for (off = begin; off < end; off += page_size, pages++) {
                        unsigned long data;
+                       off_t pos;
 
                        (void)ptrace(PTRACE_PEEKDATA, pid, (void *)off, &data);
+                       pos = lseek(fdmem, (off_t)off, SEEK_SET);
+                       if (pos == (off_t)off) {
+                               size_t sz;
+
+                               sz = read(fdmem, &data, sizeof data);
+                               (void)sz;
+                       }
+
                        pages_touched++;
                }
        }
@@ -223,14 +237,12 @@
         *  count these in the stats
         */
        if (has_maps) {
-               *procs += 1;
+               (*procs)++;
                *total_pages_touched += pages_touched;
-       } else {
-               *kthreads += 1;
        }
 
        if (opt_flags & OPT_VERBOSE) {
-               (void)printf("PID:%5d, %12zu pages, %12" PRId64 " pages 
touched\r", pid, pages,
+               (void)printf("PID:%6d, %12zu pages, %12" PRId64 " pages 
touched\r", pid, pages,
                        *total_pages_touched);
                (void)fflush(stdout);
        }
@@ -250,9 +262,10 @@
 static inline int pagein_all_procs(
        const int32_t page_size,
        int32_t *const procs,
-       int32_t *const kthreads,
        int32_t *const total_procs,
-       int64_t *const total_pages_touched)
+       int64_t *const total_pages_touched,
+       int64_t *const total_pages_skipped,
+       int64_t *const total_mappings)
 {
        DIR *dp;
        struct dirent *d;
@@ -267,8 +280,9 @@
                if (isdigit(d->d_name[0]) &&
                     sscanf(d->d_name, "%d", &pid) == 1) {
                        *total_procs += 1;
-                       pagein_proc(page_size, pid, procs, kthreads,
-                               total_pages_touched);
+                       pagein_proc(page_size, pid, procs,
+                               total_pages_touched, total_pages_skipped,
+                               total_mappings);
                }
        }
 
@@ -283,8 +297,10 @@
        int64_t swapfree_begin, swapfree_end;
        int64_t delta;
        int64_t total_pages_touched = 0ULL;
+       int64_t total_pages_skipped = 0ULL;
+       int64_t total_mappings = 0ULL;
        static int32_t total_procs = 0;         /* static noclobber */
-       int32_t procs = 0, kthreads = 0;
+       int32_t procs = 0;
        const int32_t page_size = get_page_size();
        const int32_t scale = page_size / 1024;
        static pid_t pid = -1;                  /* static noclobber */
@@ -294,7 +310,7 @@
        uint8_t stack[SIGSTKSZ + STACK_ALIGNMENT];
 
        for (;;) {
-               int c = getopt(argc, argv, "adhp:tvw");
+               int c = getopt(argc, argv, "ahp:v");
                if (c == -1)
                        break;
 
@@ -317,9 +333,6 @@
                case 'v':
                        opt_flags |= OPT_VERBOSE;
                        break;
-               case 'w':
-                       opt_flags |= OPT_TOUCH_WRITEABLE;
-                       break;
                default:
                        show_help();
                        exit(EXIT_FAILURE);
@@ -360,13 +373,16 @@
                
        get_memstats(&memfree_begin, &swapfree_begin);
        if (opt_flags & OPT_ALL)
-               pagein_all_procs(page_size, &procs, &kthreads, &total_procs, 
&total_pages_touched);
+               pagein_all_procs(page_size, &procs,
+                                &total_procs, &total_pages_touched,
+                                &total_pages_skipped, &total_mappings);
 
        if (opt_flags & OPT_BY_PID) {
                int ret;
 
-               ret = pagein_proc(page_size, pid, &procs, &kthreads,
-                       &total_pages_touched);
+               ret = pagein_proc(page_size, pid, &procs,
+                       &total_pages_touched, &total_pages_skipped,
+                       &total_mappings);
                if (ret < 0) {
                        (void)fprintf(stderr, "cannot page in PID %d errno = %d 
(%s)\n",
                                pid, -ret, strerror(-ret));
@@ -384,10 +400,11 @@
 finish:
        if (opt_flags & OPT_ALL) {
                (void)printf("Processes scanned:     %" PRIu32 "\n", 
total_procs);
-               (void)printf("Kernel threads:        %" PRIu32 " (skipped)\n", 
kthreads);
                (void)printf("Processes touched:     %" PRIu32 "\n", procs);
        }
+       (void)printf("Page mappings visited: %" PRIu64 "\n", total_mappings);
        (void)printf("Pages touched:         %" PRIu64 "\n", 
total_pages_touched);
+       (void)printf("Pages skipped:         %" PRIu64 " (unreadable)\n", 
total_pages_skipped);
        delta = memfree_begin - memfree_end;
        (void)printf("Free memory decrease:  %" PRId64 "K (%" PRId64 " 
pages)\n",
                delta, delta / scale);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pagein-0.01.00/snap/Makefile 
new/pagein-0.01.04/snap/Makefile
--- old/pagein-0.01.00/snap/Makefile    1970-01-01 01:00:00.000000000 +0100
+++ new/pagein-0.01.04/snap/Makefile    2020-02-26 15:09:26.000000000 +0100
@@ -0,0 +1,6 @@
+all:
+       snapcraft
+
+clean:
+       rm -rf setup *.snap
+       snapcraft clean
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pagein-0.01.00/snap/snapcraft.yaml 
new/pagein-0.01.04/snap/snapcraft.yaml
--- old/pagein-0.01.00/snap/snapcraft.yaml      1970-01-01 01:00:00.000000000 
+0100
+++ new/pagein-0.01.04/snap/snapcraft.yaml      2020-02-26 15:09:26.000000000 
+0100
@@ -0,0 +1,22 @@
+name: pagein
+version: git
+version-script: |
+    echo $(git describe --tags)
+summary: tool to force swapped out pages back into memory
+description: Pagein is a tool that forces pages that are in swap to be paged 
in back to memory.  The main usecase for pagein is to exercise the VM and swap 
subsystems for testing purposes.
+confinement: devmode
+type: app
+grade: stable
+
+parts:
+    pagein:
+        plugin: make
+        source: git://github.com/ColinIanKing/pagein
+        build-packages:
+            - gcc
+            - make
+
+apps:
+    pagein:
+        command: usr/bin/pagein
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/pagein-0.01.00/snapcraft/Makefile 
new/pagein-0.01.04/snapcraft/Makefile
--- old/pagein-0.01.00/snapcraft/Makefile       2018-01-14 17:22:01.000000000 
+0100
+++ new/pagein-0.01.04/snapcraft/Makefile       1970-01-01 01:00:00.000000000 
+0100
@@ -1,18 +0,0 @@
-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-1')
-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/pagein-0.01.00/snapcraft/snapcraft.yaml 
new/pagein-0.01.04/snapcraft/snapcraft.yaml
--- old/pagein-0.01.00/snapcraft/snapcraft.yaml 2018-01-14 17:22:01.000000000 
+0100
+++ new/pagein-0.01.04/snapcraft/snapcraft.yaml 1970-01-01 01:00:00.000000000 
+0100
@@ -1,20 +0,0 @@
-name: pagein
-version: 0.00.03-20170425-1-25-20f7268
-summary: tool to force swapped out pages back into memory
-description: Pagein is a tool that forces pages that are in swap to be paged 
in back to memory.  The main usecase for pagein is to exercise the VM and swap 
subsystems for testing purposes.
-confinement: devmode
-type: app
-grade: stable
-
-parts:
-    pagein:
-        plugin: make
-        source: ..
-        build-packages:
-            - gcc
-            - make
-
-apps:
-    pagein:
-        command: usr/bin/pagein
-


Reply via email to