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