diff options
author | Jose Castillo <jcastillo@redhat.com> | 2023-10-23 21:29:33 +0100 |
---|---|---|
committer | Jake Hunsaker <jacob.r.hunsaker@gmail.com> | 2023-11-06 12:16:03 -0800 |
commit | b7a0aff01f1fd3d06fd38efafdd102d4c29a3c23 (patch) | |
tree | 9ca1888b3a1b956f9b9ebed84b3a84b79c42b716 | |
parent | c47c78a8f18875e105b7bd8a17801e4f941f24e7 (diff) | |
download | sos-b7a0aff01f1fd3d06fd38efafdd102d4c29a3c23.tar.gz |
[kernelrt] Update options format for tuna
In newer versions of tuna, the option -P has been
substituted for 'show_threads'.
Test if the new option is present in 'tuna --help'
and if so, use it.
Closes: RH SUPDEV-150
Signed-off-by: Jose Castillo <jcastillo@redhat.com>
-rw-r--r-- | sos/report/plugins/kernelrt.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sos/report/plugins/kernelrt.py b/sos/report/plugins/kernelrt.py index ee666978..6d14507c 100644 --- a/sos/report/plugins/kernelrt.py +++ b/sos/report/plugins/kernelrt.py @@ -9,7 +9,7 @@ # # See the LICENSE file in the source distribution for further information. -from sos.report.plugins import Plugin, RedHatPlugin +from sos.report.plugins import Plugin, RedHatPlugin, SoSPredicate class KernelRT(Plugin, RedHatPlugin): @@ -36,6 +36,12 @@ class KernelRT(Plugin, RedHatPlugin): # note: rhbz#1059685 'tuna - NameError: global name 'cgroups' is not # defined this command throws an exception on versions prior to # 0.10.4-5. - self.add_cmd_output('tuna -CP') + co = {'cmd': 'tuna --help', 'output': '-P'} + option_present = self.test_predicate( + self, pred=SoSPredicate(self, cmd_outputs=co) + ) + self.add_cmd_output( + f"tuna {'-CP' if option_present else 'show_threads -C'}" + ) # vim: set et ts=4 sw=4 : |