|
|
bceef4 |
From af5597bfa41521e10f4ef5095f137b2ef5bcd661 Mon Sep 17 00:00:00 2001
|
|
|
bceef4 |
From: =?UTF-8?q?Toke=20H=C3=B8iland-J=C3=B8rgensen?= <toke@redhat.com>
|
|
|
bceef4 |
Date: Wed, 20 May 2020 15:05:03 +0200
|
|
|
bceef4 |
Subject: [PATCH] [xdp] Add XDP plugin
|
|
|
bceef4 |
MIME-Version: 1.0
|
|
|
bceef4 |
Content-Type: text/plain; charset=UTF-8
|
|
|
bceef4 |
Content-Transfer-Encoding: 8bit
|
|
|
bceef4 |
|
|
|
bceef4 |
This adds a plugin for gathering information about the loaded XDP programs
|
|
|
bceef4 |
on a system, using the xdp-loader tool in the xdp-tools package. This is
|
|
|
bceef4 |
complementary with the existing eBPF plugin, because this plugin supports
|
|
|
bceef4 |
getting status for multiple XDP programs on each interface as supported by
|
|
|
bceef4 |
libxdp.
|
|
|
bceef4 |
|
|
|
bceef4 |
For now, this just prints the output of 'xdp-loader status' which will list
|
|
|
bceef4 |
any XDP programs attached. We don't currently support structured
|
|
|
bceef4 |
output (such as JSON) from xdp-tools, but should we add that in the future
|
|
|
bceef4 |
we can of course update this plugin.
|
|
|
bceef4 |
|
|
|
bceef4 |
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
|
|
|
bceef4 |
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
|
|
|
bceef4 |
---
|
|
|
bceef4 |
sos/plugins/xdp.py | 21 +++++++++++++++++++++
|
|
|
bceef4 |
1 file changed, 21 insertions(+)
|
|
|
bceef4 |
create mode 100644 sos/plugins/xdp.py
|
|
|
bceef4 |
|
|
|
bceef4 |
diff --git a/sos/plugins/xdp.py b/sos/plugins/xdp.py
|
|
|
bceef4 |
new file mode 100644
|
|
|
bceef4 |
index 00000000..2e18048b
|
|
|
bceef4 |
--- /dev/null
|
|
|
bceef4 |
+++ b/sos/plugins/xdp.py
|
|
|
bceef4 |
@@ -0,0 +1,21 @@
|
|
|
bceef4 |
+# This file is part of the sos project: https://github.com/sosreport/sos
|
|
|
bceef4 |
+#
|
|
|
bceef4 |
+# This copyrighted material is made available to anyone wishing to use,
|
|
|
bceef4 |
+# modify, copy, or redistribute it subject to the terms and conditions of
|
|
|
bceef4 |
+# version 2 of the GNU General Public License.
|
|
|
bceef4 |
+#
|
|
|
bceef4 |
+# See the LICENSE file in the source distribution for further information.
|
|
|
bceef4 |
+
|
|
|
bceef4 |
+from sos.plugins import Plugin, RedHatPlugin, DebianPlugin, \
|
|
|
bceef4 |
+ UbuntuPlugin
|
|
|
bceef4 |
+
|
|
|
bceef4 |
+
|
|
|
bceef4 |
+class Xdp(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
|
|
|
bceef4 |
+
|
|
|
bceef4 |
+ short_desc = 'XDP program information'
|
|
|
bceef4 |
+ plugin_name = 'xdp'
|
|
|
bceef4 |
+ profiles = ('system', 'kernel', 'network')
|
|
|
bceef4 |
+ packages = ('xdp-tools',)
|
|
|
bceef4 |
+
|
|
|
bceef4 |
+ def setup(self):
|
|
|
bceef4 |
+ self.add_cmd_output('xdp-loader status')
|
|
|
bceef4 |
--
|
|
|
bceef4 |
diff --git a/sos/plugins/xdp.py b/sos/plugins/xdp.py
|
|
|
bceef4 |
--- a/sos/plugins/xdp.py
|
|
|
bceef4 |
+++ b/sos/plugins/xdp.py
|
|
|
bceef4 |
@@ -11,6 +11,8 @@ from sos.plugins import Plugin, RedHatPl
|
|
|
bceef4 |
|
|
|
bceef4 |
|
|
|
bceef4 |
class Xdp(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
|
|
|
bceef4 |
+ """XDP program information
|
|
|
bceef4 |
+ """
|
|
|
bceef4 |
|
|
|
bceef4 |
short_desc = 'XDP program information'
|
|
|
bceef4 |
plugin_name = 'xdp'
|
|
|
bceef4 |
--
|
|
|
bceef4 |
2.21.3
|
|
|
bceef4 |
|