From 4a3048687c9220157ae7d79d90fbf9b7c3b934ea Mon Sep 17 00:00:00 2001 From: Leah Leshchinsky Date: Tue, 2 Nov 2021 12:30:38 -0400 Subject: [PATCH] tuna: Add distinction between spread and move to error message Resolves: rhbz#2012243 Signed-off-by: Leah Leshchinsky --- ...tion-between-spread-and-move-to-erro.patch | 49 +++++++++++++++++++ tuna.spec | 8 ++- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 tuna-Add-distinction-between-spread-and-move-to-erro.patch diff --git a/tuna-Add-distinction-between-spread-and-move-to-erro.patch b/tuna-Add-distinction-between-spread-and-move-to-erro.patch new file mode 100644 index 0000000..da88748 --- /dev/null +++ b/tuna-Add-distinction-between-spread-and-move-to-erro.patch @@ -0,0 +1,49 @@ +From c9d2fc624905cd0af96ee9f84317d562a042fe14 Mon Sep 17 00:00:00 2001 +From: Leah Leshchinsky +Date: Wed, 6 Oct 2021 13:21:50 -0400 +Subject: [PATCH] tuna: Add distinction between --spread and --move to error + message + +Currently, the command `tuna --cpus=CPU-LIST --spread` generates an +error with the warning "tuna: --move requires a list of threads/irqs!". +Similarly, when the command `tuna --threads=THREAD-LIST --spread` is +run, it generates the warning "tuna: --move requires a cpu list!". + +This can be confusing to the user, especially with commands that use both +the "--spread" and "--move" flags. The warning should specify "--spread" +when that is the source of the error. + +Check whether the argument is a move or spread and update the warning +string accordingly. + +Signed-off-by: Leah Leshchinsky +--- + tuna-cmd.py | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +diff --git a/tuna-cmd.py b/tuna-cmd.py +index 8617966..8dfad9e 100755 +--- a/tuna-cmd.py ++++ b/tuna-cmd.py +@@ -633,15 +633,14 @@ def main(): + elif o in ("-n", "--show_sockets"): + show_sockets = True + elif o in ("-m", "--move", "-x", "--spread"): ++ spread = o in ("-x", "--spread") + if not cpu_list: +- print("tuna: --move " + _("requires a cpu list!")) ++ print("tuna: %s " % ("--spread" if spread else "--move") + _("requires a cpu list!")) + sys.exit(2) + if not (thread_list or irq_list): +- print("tuna: --move " + _("requires a list of threads/irqs!")) ++ print("tuna: %s " % ("--spread" if spread else "--move") + _("requires a list of threads/irqs!")) + sys.exit(2) + +- spread = o in ("-x", "--spread") +- + if thread_list: + tuna.move_threads_to_cpu(cpu_list, thread_list, spread=spread) + +-- +2.27.0 + diff --git a/tuna.spec b/tuna.spec index 648874e..9b97b47 100644 --- a/tuna.spec +++ b/tuna.spec @@ -1,6 +1,6 @@ Name: tuna Version: 0.16 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 Summary: Application tuning GUI & command line utility URL: https://git.kernel.org/pub/scm/utils/tuna/tuna.git @@ -15,6 +15,7 @@ Requires: python3-linux-procfs >= 0.6 # Patches Patch1: tuna-Print-warning-if-setting-affinity-results-in-EBUSY.patch +Patch2: tuna-Add-distinction-between-spread-and-move-to-erro.patch %description Provides interface for changing scheduler and IRQ tunables, at whole CPU and at @@ -28,6 +29,7 @@ installed. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build %py3_build @@ -69,6 +71,10 @@ done %{_datadir}/polkit-1/actions/org.tuna.policy %changelog +* Tue Nov 02 2021 Leah Leshchinsky - 0.16-4 +- Add distinction between spread and move to error message +Resolves: rhbz#2012243 + * Thu Oct 28 2021 John Kacur - 0.16-3 - Print warning if setaffinity causes EBUSY and continue Resolves: rhbz#2016540