diff --git a/SOURCES/tuna-Exit-with-error-msg-on-s390-and-s390x-for-unsup.patch b/SOURCES/tuna-Exit-with-error-msg-on-s390-and-s390x-for-unsup.patch new file mode 100644 index 0000000..7dd0114 --- /dev/null +++ b/SOURCES/tuna-Exit-with-error-msg-on-s390-and-s390x-for-unsup.patch @@ -0,0 +1,56 @@ +From 1202ad0fdee7d46a7c0a6a6263bb2efd713f8cf8 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Thu, 14 Mar 2019 17:14:30 +0100 +Subject: [PATCH 5/5] tuna: Exit with error msg on s390 and s390x for + unsupported irq ops + +On s390 and s390x any operations involving irqs will fail. +Try to exit cleanly with an error message that these operations are +unsupported on s390 and s390x + +Signed-off-by: John Kacur +--- + tuna/tuna.py | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +diff --git a/tuna/tuna.py b/tuna/tuna.py +index eae0408c2fe7..42db4cfcee3f 100755 +--- a/tuna/tuna.py ++++ b/tuna/tuna.py +@@ -3,6 +3,7 @@ + + import copy, ethtool, errno, os, procfs, re, schedutils, sys, shlex + import help, fnmatch ++import platform + from procfs import utilist + + try: +@@ -334,9 +335,24 @@ def affinity_remove_cpus(affinity, cpus, nr_cpus): + affinity = list(set(affinity) - set(cpus)) + return affinity + ++# True if machine is s390 or s390x ++def is_s390(): ++ machine = platform.machine() ++ if re.search('s390', machine): ++ return True ++ else: ++ return False ++ + # Shound be moved to python_linux_procfs.interrupts, shared with interrupts.parse_affinity, etc. + def parse_irq_affinity_filename(filename, nr_cpus): +- f = file("/proc/irq/%s" % filename) ++ try: ++ f = open("/proc/irq/%s" % filename) ++ except IOError as err: ++ if is_s390(): ++ print >> sys.stderr, "This operation is not supported on s390" ++ print("tuna: %s" % err) ++ sys.exit(2) ++ + line = f.readline() + f.close() + return utilist.bitmasklist(line, nr_cpus) +-- +2.20.1 + diff --git a/SOURCES/tuna-Make-sure-currentFile-is-not-NULL-before-testing.patch b/SOURCES/tuna-Make-sure-currentFile-is-not-NULL-before-testing.patch new file mode 100644 index 0000000..22ecf01 --- /dev/null +++ b/SOURCES/tuna-Make-sure-currentFile-is-not-NULL-before-testing.patch @@ -0,0 +1,28 @@ +From 64b01e239dcb7e03563d6151102316bef20a5bb9 Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Wed, 30 Jan 2019 16:31:08 +0100 +Subject: [PATCH] tuna: Make sure currentFile is not NULL before testing + +Make sure currentFile is assigned a value before testing it. + +Signed-off-by: John Kacur +--- + tuna/gui/profileview.py | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tuna/gui/profileview.py b/tuna/gui/profileview.py +index fe670bfca3c7..fc243995621b 100644 +--- a/tuna/gui/profileview.py ++++ b/tuna/gui/profileview.py +@@ -332,6 +332,8 @@ class profileview: + if self.setProfileFileList(): + self.configFileTree.set_cursor(0) + currentFile = self.get_current_tree_selection() ++ else: ++ currentFile = '' + if self.config.checkConfigFile(self.config.config['root'] + currentFile) == '': + self.commonview.updateCommonView() + return True +-- +2.20.1 + diff --git a/SOURCES/tuna-fix-undefined-global-name-stderr.patch b/SOURCES/tuna-fix-undefined-global-name-stderr.patch new file mode 100644 index 0000000..851cfbe --- /dev/null +++ b/SOURCES/tuna-fix-undefined-global-name-stderr.patch @@ -0,0 +1,28 @@ +From 2872033ee669c130d2c5b630915120f782f3f33c Mon Sep 17 00:00:00 2001 +From: John Kacur +Date: Thu, 31 Jan 2019 16:15:34 +0100 +Subject: [PATCH] tuna: fix undefined global name stderr + +Fix undefined global name stderr. Should be sys.stderr + +Signed-off-by: John Kacur +--- + tuna/tuna.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tuna/tuna.py b/tuna/tuna.py +index 213bbf667caf..eae0408c2fe7 100755 +--- a/tuna/tuna.py ++++ b/tuna/tuna.py +@@ -272,7 +272,7 @@ def move_threads_to_cpu(cpus, pid_list, set_affinity_warning = None, + # process died + continue + elif e[0] == errno.EINVAL: # unmovable thread) +- print >> stderr, "thread %(pid)d cannot be moved as requested" %{'pid':pid} ++ print >> sys.stderr, "thread %(pid)d cannot be moved as requested" %{'pid':pid} + continue + raise e + return changed +-- +2.20.1 + diff --git a/SPECS/tuna.spec b/SPECS/tuna.spec index 53a4c1b..6fc828b 100644 --- a/SPECS/tuna.spec +++ b/SPECS/tuna.spec @@ -3,7 +3,7 @@ Name: tuna Version: 0.13 -Release: 6%{?dist} +Release: 9%{?dist} License: GPLv2 Summary: Application tuning GUI & command line utility Group: Applications/System @@ -15,6 +15,9 @@ Patch3: CLI-start-a-process-from-tuna.patch Patch4: docs-upgrade-tuna.8-man-page-with-option-r.patch Patch5: tuna-Use-errno-codes-instead-of-numbers.patch Patch6: tuna-isolate_cpus-exit-with-a-message.patch +Patch7: tuna-Make-sure-currentFile-is-not-NULL-before-testing.patch +Patch8: tuna-fix-undefined-global-name-stderr.patch +Patch9: tuna-Exit-with-error-msg-on-s390-and-s390x-for-unsup.patch URL: https://git.kernel.org/pub/scm/utils/tuna/tuna.git BuildArch: noarch @@ -59,6 +62,9 @@ priority is changed, be it using tuna or plain chrt & taskset. %patch4 -p1 %patch5 -p1 %patch6 -p1 +%patch7 -p1 +%patch8 -p1 +%patch9 -p1 %build %{__python} setup.py build @@ -113,6 +119,18 @@ rm -rf %{buildroot} %doc docs/oscilloscope+tuna.pdf %changelog +* Thu Mar 14 2019 John Kacur - 0.13-9 +- tuna: Exit with error msg on s390 and s390x for unsupported irq ops +Resolves: rhbz#1637910 + +* Thu Jan 31 2019 John Kacur - 0.13-8 +- tuna - Fix undefined global name stderr +Resolves: rhbz#1671285 + +* Wed Jan 30 2019 John Kacur - 0.13-7 +- tuna: profileview: Make sure currentFile has a value before using it. +Resolves: rhbz#1526445 + * Wed Sep 13 2017 John Kacur - 0.13-6 - Use errno codes instead of plain numbers - Exit with a message instead of a traceback in isolate_cpus