iotop/SOURCES/iotop-0.6-delayacctcheck.patch

30 lines
889 B
Diff

diff -up iotop-0.6/iotop/data.py.delayacctcheck iotop-0.6/iotop/data.py
--- iotop-0.6/iotop/data.py.delayacctcheck 2023-12-11 22:15:47.280664665 +0100
+++ iotop-0.6/iotop/data.py 2023-12-11 22:14:16.689868890 +0100
@@ -27,6 +27,7 @@ import stat
import struct
import sys
import time
+from procfs import cmdline
#
# Check for requirements:
@@ -455,8 +456,17 @@ class ProcessList(DumpableObject):
def sysctl_task_delayacct():
+ """ WAS:
try:
with open('/proc/sys/kernel/task_delayacct') as f:
return bool(int(f.read().strip()))
except FileNotFoundError:
return None
+
+
+ Because /proc/sys/kernel/task_delayacct doesn't exist on RHEL8,
+ it always returns None, which is equivalent to False in the end.
+
+ On RHEL8, delayacct_on kernel variable is enabled by default
+ """
+ return 'nodelayacct' not in cmdline().keys()