Skip to content

Commit

Permalink
[kernelrt] Update options format for tuna
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jcastill committed Oct 24, 2023
1 parent ab36ea6 commit 04a546f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sos/report/plugins/kernelrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -36,6 +36,12 @@ def setup(self):
# 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')
tuna_cmd = 'tuna'
co = {'cmd': '%s --help' % tuna_cmd, 'output': 'show_threads'}
if self.test_predicate(self, pred=SoSPredicate(self, cmd_outputs=co)):
tuna_cmd += ' show_threads -C'
else:
tuna_cmd += ' -CP'
self.add_cmd_output(tuna_cmd)

# vim: set et ts=4 sw=4 :

0 comments on commit 04a546f

Please sign in to comment.