Reverting the previous syntax warnings fix patch and replacing it with the

tuna-Fix-string-syntax-warnings-with-raw-strings patch.
Using the same resolves number.
Resolves: RHEL-106288

Signed-off-by: John B. Wyatt IV <jwyatt@redhat.com>
This commit is contained in:
John B. Wyatt IV 2025-07-31 10:14:16 -04:00
parent 5436f2f8f1
commit 287ce62eca
3 changed files with 67 additions and 43 deletions

View File

@ -1,41 +0,0 @@
From 5636a942a4e46c0d34647807903c47049d621707 Mon Sep 17 00:00:00 2001
From: "John B. Wyatt IV" <jwyatt@redhat.com>
Date: Wed, 4 Dec 2024 15:31:58 -0500
Subject: [PATCH] tuna: Fix help.py syntax warnings
Fix two syntax warnings with what looks like should have been a new line
like the other help entries.
Signed-off-by: John B. Wyatt IV <jwyatt@redhat.com>
Signed-off-by: John B. Wyatt IV <sageofredondo@gmail.com>
- edited commit message
Signed-off-by: John Kacur <jkacur@redhat.com>
---
tuna/help.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tuna/help.py b/tuna/help.py
index fa47ae8..c913a16 100644
--- a/tuna/help.py
+++ b/tuna/help.py
@@ -44,7 +44,7 @@ PROC_SYS_HELP = {
'net.core.rmem_default':N_('The default setting of the socket receive buffer in bytes.'),
'net.core.rmem_max':N_('The maximum receive socket buffer size in bytes.'),
'net.core.rps_sock_flow_entries':N_('This controls the maximum number of sockets/flows that the kernel can steer towards any specified CPU. This is a system-wide, shared limit.'),
- 'net.core.somaxconn':N_('Limit of socket listen() backlog, known in userspace as SOMAXCONN. See also tcp_max_syn_backlog for additional tuning for TCP sockets.\Default: 128.'),
+ 'net.core.somaxconn':N_('Limit of socket listen() backlog, known in userspace as SOMAXCONN. See also tcp_max_syn_backlog for additional tuning for TCP sockets.\nDefault: 128.'),
'net.core.warnings':N_('This controls console messages from the networking stack that can occur because of problems on the network like duplicate address or bad checksums. Normally, this should be enabled, but if the problem persists the messages can be disabled.'),
'net.core.wmem_default':N_('The default setting (in bytes) of the socket send buffer.'),
'net.core.wmem_max':N_('The maximum send socket buffer size in bytes.'),
@@ -118,7 +118,7 @@ PROC_SYS_HELP = {
'net.ipv4.tcp_reordering':N_('Maximal reordering of packets in a TCP stream.\nDefault: 3'),
'net.ipv4.tcp_retrans_collapse':N_('Bug-to-bug compatibility with some broken printers. On retransmit try to send bigger packets to work around bugs in certain TCP stacks.'),
'net.ipv4.tcp_retries1':N_('This value influences the time, after which TCP decides, that something is wrong due to unacknowledged RTO retransmissions, and reports this suspicion to the network layer.\nRFC 1122 recommends at least 3 retransmissions, which is the default.\nDefault: 3'),
- 'net.ipv4.tcp_retries2':N_('This value influences the timeout of an alive TCP connection, when RTO retransmissions remain unacknowledged. Given a value of N, a hypothetical TCP connection following exponential backoff with an initial RTO of TCP_RTO_MIN would retransmit N times before killing the connection at the (N+1)th RTO. The default value of 15 yields a hypothetical timeout of 924.6 seconds and is a lower bound for the effective timeout. TCP will effectively time out at the first RTO which exceeds the hypothetical timeout. RFC 1122 recommends at least 100 seconds for the timeout, which corresponds to a value of at least 8.\Default: 8'),
+ 'net.ipv4.tcp_retries2':N_('This value influences the timeout of an alive TCP connection, when RTO retransmissions remain unacknowledged. Given a value of N, a hypothetical TCP connection following exponential backoff with an initial RTO of TCP_RTO_MIN would retransmit N times before killing the connection at the (N+1)th RTO. The default value of 15 yields a hypothetical timeout of 924.6 seconds and is a lower bound for the effective timeout. TCP will effectively time out at the first RTO which exceeds the hypothetical timeout. RFC 1122 recommends at least 100 seconds for the timeout, which corresponds to a value of at least 8.\nDefault: 8'),
'net.ipv4.tcp_rfc1337':N_('If set, the TCP stack behaves conforming to RFC1337. If unset, we are not conforming to RFC, but prevent TCP TIME_WAIT assassination.\nDefault: 0'),
'net.ipv4.tcp_rmem':N_('Vector of 3 values: min, default, max\n - min: Minimal size of receive buffer used by TCP sockets. It is guaranteed to each TCP socket, even under moderate memory pressure.\nDefault: 8K\n - default: initial size of receive buffer used by TCP sockets. This value overrides net.core.rmem_default used by other protocols. Default: 87380 bytes. This value results in window of 65535 with default setting of tcp_adv_win_scale and tcp_app_win:0 and a bit less for default tcp_app_win. See below about these variables. - max: maximal size of receive buffer allowed for automatically selected receiver buffers for TCP socket. This value does not override net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables automatic tuning of that socket\'s receive buffer size, in which case this value is ignored.\nDefault: between 87380B and 4MB, depending on RAM size.'),
'net.ipv4.tcp_sack':N_('Enable select acknowledgments (SACKS).'),
--
2.50.1

View File

@ -0,0 +1,59 @@
From aca839256c548b1e4b6b891eb6e3e01d78972062 Mon Sep 17 00:00:00 2001
From: "John B. Wyatt IV" <jwyatt@redhat.com>
Date: Mon, 28 Oct 2024 17:57:15 -0400
Subject: [PATCH] tuna: Fix string syntax warnings with raw strings
tuna save <filename> allows you to save your kthreads tunables to
a file to be used by rtctl. There were several backslashes that produce
an error that pylint and Python (at least 3.12) gives a SyntaxWarning:
invalid escape sequence
Switch the strings written to the file with raw strings to resolve the
warning for this section of the code.
Tested by comparing the diffs of the files.
Signed-off-by: John B. Wyatt IV <jwyatt@redhat.com>
Signed-off-by: John B. Wyatt IV <sageofredondo@gmail.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
---
tuna/tuna.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tuna/tuna.py b/tuna/tuna.py
index bd678e2..d4c3e2c 100755
--- a/tuna/tuna.py
+++ b/tuna/tuna.py
@@ -669,7 +669,7 @@ def generate_rtgroups(filename, kthreads, nr_cpus):
# The regex is matched against process names as printed by "ps -eo cmd".
''' % filename)
- f.write("kthreads:*:1:*:\[.*\]$\n\n")
+ f.write(r"kthreads:*:1:*:\[.*\]$" + "\n\n")
per_cpu_kthreads = []
names = list(kthreads.keys())
@@ -688,7 +688,7 @@ def generate_rtgroups(filename, kthreads, nr_cpus):
elif common[:8] == "softirq-":
common = "(sirq|softirq)" + common[7:]
name = "s" + name[4:]
- regex = common + "\/.*"
+ regex = common + r"\/.*"
except:
idx = 0
regex = name
@@ -701,9 +701,9 @@ def generate_rtgroups(filename, kthreads, nr_cpus):
else:
mask = ",".join([hex(a) for a in \
procfs.hexbitmask(kt.affinity, nr_cpus)])
- f.write("%s:%c:%d:%s:\[%s\]$\n" % (name, \
+ f.write(r"%s:%c:%d:%s:\[%s\]$" % (name, \
tuna_sched.sched_str(kt.policy)[6].lower(), \
- kt.rtprio, mask, regex))
+ kt.rtprio, mask, regex) + "\n")
f.close()
--
2.50.1

View File

@ -2,7 +2,7 @@
Name: tuna
Version: 0.19
Release: 11%{?dist}
Release: 12%{?dist}
License: GPL-2.0-only AND LGPL-2.1-only
Summary: Application tuning GUI & command line utility
Source: https://www.kernel.org/pub/software/utils/%{name}/%{name}-%{version}.tar.xz
@ -21,7 +21,7 @@ Patch3: tuna-Don-t-start-the-gui-if-a-display-is-not-availab.patch
Patch4: 0001-tuna-extract-common-cpu-and-nics-determination-code-.patch
Patch5: 0002-tuna-Add-idle_state-control-functionality.patch
Patch6: 0003-tuna-utils-A-few-tweaks.patch
Patch7: tuna-Fix-help.py-syntax-warnings.patch
Patch7: tuna-Fix-string-syntax-warnings-with-raw-strings.patch
%description
Provides interface for changing scheduler and IRQ tunables, at whole CPU and at
@ -75,6 +75,12 @@ done
%{_datadir}/polkit-1/actions/org.tuna.policy
%changelog
* Thu Jul 31 2025 John B. Wyatt IV <jwyatt@redhat.com> - 0.19-12
- Reverting the previous syntax warnings fix patch and replacing it with the
tuna-Fix-string-syntax-warnings-with-raw-strings patch.
- Using the same resolves number.
Resolves: RHEL-106288
* Wed Jul 30 2025 John B. Wyatt IV <jwyatt@redhat.com> - 0.19-11
- Fix syntax warnings
- Switch RHEL10 pkg to use autosetup like c9s does in tuna, -v makes it more verbose