From 351b9c8bed8a0592e91cdae84ceab2499a92c9f2 Mon Sep 17 00:00:00 2001 From: John Kacur Date: Thu, 20 May 2021 11:52:53 -0400 Subject: [PATCH] Rebase to tuna-0.15 --- .gitignore | 1 + sources | 2 +- tuna-Fix-tuna-include-option-breakage.patch | 51 +++++++++++++++++++++ tuna.spec | 15 ++++-- 4 files changed, 64 insertions(+), 5 deletions(-) create mode 100644 tuna-Fix-tuna-include-option-breakage.patch diff --git a/.gitignore b/.gitignore index 80d8952..6f4ba49 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /tuna-0.13.1.tar.xz /tuna-0.14.tar.xz /tuna-0.14.1.tar.xz +/tuna-0.15.tar.xz diff --git a/sources b/sources index 4b41dea..afe0060 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (tuna-0.14.1.tar.xz) = fda7bc0da96ed2b7900f8fe42db67a7e74f83ff29b8ecf02dc3ad7131df76e6a47e3b8e66a76449be4f11020400360324d1eb4e996e9745542e2c5ee1075de69 +SHA512 (tuna-0.15.tar.xz) = de4e705fc126f087697dc31956ad80ee55a3ef932dcd0abfcacd31ff3fb4742061293f2de4e4e608b18d5840d320420dc64f746c6aa88adad38af1fb3bd968be diff --git a/tuna-Fix-tuna-include-option-breakage.patch b/tuna-Fix-tuna-include-option-breakage.patch new file mode 100644 index 0000000..55d58a6 --- /dev/null +++ b/tuna-Fix-tuna-include-option-breakage.patch @@ -0,0 +1,51 @@ +From cd9e707b23980ed568aeddac6eaa2125b651c6cc Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 3 Mar 2021 10:45:28 -0500 +Subject: [PATCH] tuna: Fix tuna --include option breakage + +The change to remove the dependency on python-schedutils +broke the --include function. + +get_affinity(pid) from python-schedutils returned a list +os.sched_getaffinity(pid) returns a set + +In many cases they can be interchanged, but not with the '+' operation +Fix this by changing affinity to a list before concatenation + +Reported-by: Mark Simmons +Signed-off-by: John Kacur +--- + tuna/tuna.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tuna/tuna.py b/tuna/tuna.py +index e5122dac1081..614a8250b054 100755 +--- a/tuna/tuna.py ++++ b/tuna/tuna.py +@@ -431,9 +431,9 @@ def include_cpus(cpus, nr_cpus): + if err.args[0] == errno.ESRCH: + continue + raise err +- if set(affinity).intersection(set(cpus)) != set(cpus): ++ if affinity.intersection(set(cpus)) != set(cpus): + previous_pid_affinities[pid] = copy.copy(affinity) +- affinity = list(set(affinity + cpus)) ++ affinity = list(affinity) + cpus + try: + os.sched_setaffinity(pid, affinity) + except OSError as err: +@@ -453,9 +453,9 @@ def include_cpus(cpus, nr_cpus): + if err.args[0] == errno.ESRCH: + continue + raise err +- if set(affinity).intersection(set(cpus)) != set(cpus): ++ if affinity.intersection(set(cpus)) != set(cpus): + previous_pid_affinities[tid] = copy.copy(affinity) +- affinity = list(set(affinity + cpus)) ++ affinity = list(affinity) + cpus + try: + os.sched_setaffinity(tid, affinity) + except OSError as err: +-- +2.26.3 + diff --git a/tuna.spec b/tuna.spec index e61e5e1..1b3394e 100644 --- a/tuna.spec +++ b/tuna.spec @@ -1,10 +1,9 @@ Name: tuna -Version: 0.14.1 -Release: 5%{?dist} +Version: 0.15 +Release: 1%{?dist} License: GPLv2 Summary: Application tuning GUI & command line utility Source: https://www.kernel.org/pub/software/utils/%{name}/%{name}-%{version}.tar.xz -Patch0: oscilloscope-move-from-pygtk2-to-gtk3-gobject.patch URL: https://rt.wiki.kernel.org/index.php/Tuna BuildArch: noarch BuildRequires: python3-devel, gettext @@ -14,6 +13,9 @@ Requires: python3-schedutils >= 0.6 # This really should be a Suggests... # Requires: python-inet_diag +# Patches +Patch1: tuna-Fix-tuna-include-option-breakage.patch + %description Provides interface for changing scheduler and IRQ tunables, at whole CPU and at per thread/IRQ level. Allows isolating CPUs for use by a specific application @@ -41,7 +43,7 @@ priority is changed, be it using tuna or plain chrt & taskset. %prep %setup -q -%patch0 -p1 +%patch1 -p1 %build %py3_build @@ -90,6 +92,11 @@ done %doc docs/oscilloscope+tuna.pdf %changelog +* Mon May 17 2021 John Kacur - 0.15-1 +- Rebase to tuna-0.15 +- This includes changes to remove the python-schedutils dependency +Resolves: rhbz#1890541 + * Fri Apr 16 2021 Mohan Boddu - 0.14.1-5 - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937