Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package cpulimit for openSUSE:Factory 
checked in at 2025-12-30 12:01:36
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cpulimit (Old)
 and      /work/SRC/openSUSE:Factory/.cpulimit.new.1928 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "cpulimit"

Tue Dec 30 12:01:36 2025 rev:10 rq:1324744 version:3.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/cpulimit/cpulimit.changes        2024-05-22 
21:35:32.644709881 +0200
+++ /work/SRC/openSUSE:Factory/.cpulimit.new.1928/cpulimit.changes      
2025-12-30 12:02:02.436690806 +0100
@@ -1,0 +2,11 @@
+Sun Dec 28 23:20:52 UTC 2025 - Dirk Müller <[email protected]>
+
+- update to 3.2:
+  * Updated kernel HZ value to default to 250 on Linux since that
+  * is the configuration default.
+  * Added new command line parameter, -j (--hz) which allows the
+    user to override the kernel HZ value. We assume 250 on Linux and
+    100 on other kernels, but the user can set this to any integer
+    value.
+
+-------------------------------------------------------------------

Old:
----
  cpulimit-3.1.tar.gz

New:
----
  cpulimit-3.2.tar.gz

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

Other differences:
------------------
++++++ cpulimit.spec ++++++
--- /var/tmp/diff_new_pack.tDX2mI/_old  2025-12-30 12:02:03.112718566 +0100
+++ /var/tmp/diff_new_pack.tDX2mI/_new  2025-12-30 12:02:03.116718730 +0100
@@ -2,7 +2,7 @@
 #
 # spec file for package cpulimit
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC and contributors
 #
 # 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:           cpulimit
-Version:        3.1
+Version:        3.2
 Release:        0
 Summary:        Limit the CPU Usage of a Process
 License:        GPL-2.0-or-later

++++++ cpulimit-3.1.tar.gz -> cpulimit-3.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpulimit-3.1/CHANGELOG new/cpulimit-3.2/CHANGELOG
--- old/cpulimit-3.1/CHANGELOG  2024-05-15 17:19:39.000000000 +0200
+++ new/cpulimit-3.2/CHANGELOG  2025-12-26 19:11:22.000000000 +0100
@@ -1,3 +1,12 @@
+========== Changes in 3.2 ================
+
+Updated kernel HZ value to default to 250 on Linux since that
+is the configuration default.
+
+Added new command line parameter, -j (--hz) which allows the user
+to override the kernel HZ value. We assume 250 on Linux and 100 on
+other kernels, but the user can set this to any integer value.
+
 ========== Changes in 3.1 ================
 
 Fixed an issue where cpulimit could crash when monitoring
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpulimit-3.1/Makefile new/cpulimit-3.2/Makefile
--- old/cpulimit-3.1/Makefile   2024-05-15 17:16:59.000000000 +0200
+++ new/cpulimit-3.2/Makefile   2025-12-26 19:11:37.000000000 +0100
@@ -1,4 +1,4 @@
-VERSION?=3.1
+VERSION?=3.2
 PREFIX?=/usr
 CFLAGS?=-Wall -O2
 CC?=clang
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpulimit-3.1/cpulimit.1 new/cpulimit-3.2/cpulimit.1
--- old/cpulimit-3.1/cpulimit.1 2023-04-03 16:08:12.000000000 +0200
+++ new/cpulimit-3.2/cpulimit.1 2025-12-26 19:10:19.000000000 +0100
@@ -28,6 +28,10 @@
 \fB\-c\fR, \fB\-\-cpu\fR
 specify the number of CPU cores available. Usually this is detected for us.
 .TP
+\fB\-j\fR, \fB\-\-hz\fR=\fIN\fR
+set the assumed kernel HZ value manually. The default on most Linux kernels 
and the default
+assumed by cpulimit is 250.
+.TP
 \fB\-l\fR, \fB\-\-limit\fR=\fIN\fR
 percentage of CPU allowed from 1 up. Usually 1 - 100, but can be higher on 
multi-core CPUs. (mandatory)
 .TP
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/cpulimit-3.1/cpulimit.c new/cpulimit-3.2/cpulimit.c
--- old/cpulimit-3.1/cpulimit.c 2024-05-15 15:47:57.000000000 +0200
+++ new/cpulimit-3.2/cpulimit.c 2025-12-26 19:08:28.000000000 +0100
@@ -64,7 +64,14 @@
 
 //kernel time resolution (inverse of one jiffy interval) in Hertz
 //i don't know how to detect it, then define to the default (not very clean!)
+// On Linux the _default_ is now 250, so we will use that on Linux. Will assume
+// 100 on other platforms, but this can be patched on a per build system basis.
+#ifdef LINUX
+#define HZ 250
+#else
 #define HZ 100
+#endif
+int my_HZ = HZ;
 
 //some useful macro
 #define min(a,b) (a<b?a:b)
@@ -522,7 +529,7 @@
                        i=(i+1)%MEM_ORDER;
                } while (i!=max);
                long used=ps[front].jiffies-ps[tail].jiffies;
-               float usage=(used*1000000.0/HZ)/dtwork;
+               float usage=(used*1000000.0/my_HZ)/dtwork;
                pusage->workingrate=1.0*dtwork/dt;
                pusage->pcpu=usage*pusage->workingrate;
                if (size==MEM_ORDER)
@@ -811,6 +818,7 @@
 
 void print_usage(FILE *stream,int exit_code) {
         fprintf(stream, "CPUlimit version %1.1f\n", VERSION);
+        fprintf(stream, "CPUlimit default HZ value %d\n", HZ);
        fprintf(stream, "Usage: %s TARGET [OPTIONS...] [-- 
PROGRAM]\n",program_name);
        fprintf(stream, "   TARGET must be exactly one of these:\n");
        fprintf(stream, "      -p, --pid=N        pid of the process\n");
@@ -823,6 +831,7 @@
         fprintf(stream, "      -b  --background   run in background\n");
         fprintf(stream, "      -f  --foreground   launch target process in 
foreground and wait for it to exit\n");
         fprintf(stream, "      -c  --cpu=N        override the detection of 
CPUs on the machine.\n");
+        fprintf(stream, "      -j  --hz=N         override kernel HZ value 
(defaults to %d).\n", HZ);
        fprintf(stream, "      -l, --limit=N      percentage of cpu allowed 
from 1 up.\n");
         fprintf(stream, "                         Usually 1 - %d00, but can be 
higher\n", NCPU);
         fprintf(stream, "                         on multi-core CPUs 
(mandatory)\n");
@@ -899,16 +908,17 @@
        int next_option;
        /* A string listing valid short options letters. */
         #ifdef LINUX
-       const char* short_options="p:e:P:l:c:s:bfqkmrvzh";
+       const char* short_options="p:e:P:j:l:c:s:bfqkmrvzh";
         PROGRAM_DATA program_data;
         #else
-       const char* short_options="p:e:P:l:c:s:bfqkrvzh";
+       const char* short_options="p:e:P:j:l:c:s:bfqkrvzh";
         #endif
        /* An array describing valid long options. */
        const struct option long_options[] = {
                { "pid", required_argument, NULL, 'p' },
                { "exe", required_argument, NULL, 'e' },
                { "path", required_argument, NULL, 'P' },
+               { "hz", required_argument, NULL, 'j' },
                { "limit", required_argument, NULL, 'l' },
                 { "background", no_argument, NULL, 'b' },
                 { "foreground", no_argument, NULL, 'f' },
@@ -941,7 +951,7 @@
 
         opterr = 0;      // avoid unwanted error messages for unknown 
parameters
        do {
-               next_option = getopt_long (argc, argv, 
short_options,long_options, NULL);
+               next_option = getopt_long (argc, argv, short_options, 
long_options, NULL);
                switch(next_option) {
                         case 'b':
                                 run_in_background = TRUE;
@@ -971,6 +981,10 @@
                                process_ok = TRUE;
                                 last_known_argument += 2;
                                break;
+                        case 'j':
+                                my_HZ = atoi(optarg);
+                                last_known_argument += 2;
+                                break;
                        case 'l':
                                perclimit=atoi(optarg);
                                limit_ok = TRUE;
@@ -1035,6 +1049,8 @@
        } while(next_option != -1);
 
         signal(SIGCHLD, Child_Done);
+        if (verbose)
+           printf("Proceeding with kernel frequency set to %d\n", my_HZ);
 
         // try to launch a program passed on the command line
         // But only if we do not already have a PID to watch

Reply via email to