Blame SOURCES/sos-bz1768956-ebpf-per-namespace.patch

30a705
From 93ba31695ad532ce96c93dc511f966e7a3e9ae94 Mon Sep 17 00:00:00 2001
30a705
From: Pavel Moravec <pmoravec@redhat.com>
30a705
Date: Tue, 3 Dec 2019 22:03:10 +0100
30a705
Subject: [PATCH] [kernel,networking] collect bpftool net list for each
30a705
 namespace
30a705
30a705
- move "bpftool net list" command execution from kernel to networking
30a705
plugin as it belongs rather to networking.
30a705
- collect that output per each net name space as well
30a705
30a705
Resolves: #1874
30a705
30a705
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
30a705
---
30a705
 sos/plugins/kernel.py     | 4 ----
30a705
 sos/plugins/networking.py | 7 ++++++-
30a705
 2 files changed, 6 insertions(+), 5 deletions(-)
30a705
30a705
diff --git a/sos/plugins/kernel.py b/sos/plugins/kernel.py
30a705
index 5c8521433..8224e5c05 100644
30a705
--- a/sos/plugins/kernel.py
30a705
+++ b/sos/plugins/kernel.py
30a705
@@ -142,10 +142,6 @@ class Kernel(Plugin, RedHatPlugin, Debia
30a705
         if not self.get_option("trace"):
30a705
             self.add_forbidden_path("/sys/kernel/debug/tracing/trace")
30a705
 
30a705
-        # collect list of bpf program attachments in the kernel
30a705
-        # networking subsystem
30a705
-        self.add_cmd_output("bpftool net list")
30a705
-
30a705
         # collect list of eBPF programs and maps and their dumps
30a705
         prog_file = self.get_cmd_output_now("bpftool -j prog list")
30a705
         for prog_id in self.get_bpftool_prog_ids(prog_file):
30a705
diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py
30a705
index 2f655042a..0026cda9d 100644
30a705
--- a/sos/plugins/networking.py
30a705
+++ b/sos/plugins/networking.py
30a705
@@ -205,6 +205,10 @@ class Networking(Plugin):
30a705
         if self.get_option("traceroute"):
30a705
             self.add_cmd_output("/bin/traceroute -n %s" % self.trace_host)
30a705
 
30a705
+        # collect list of bpf program attachments in the kernel
30a705
+        # networking subsystem
30a705
+        self.add_cmd_output("bpftool net list")
30a705
+
30a705
         # Capture additional data from namespaces; each command is run
30a705
         # per-namespace.
30a705
         ip_netns_file = self.get_cmd_output_now("ip netns")
30a705
@@ -212,7 +216,8 @@ def setup(self):
30a705
                     ns_cmd_prefix + "iptables-save",
30a705
                     ns_cmd_prefix + "netstat %s -neopa" % self.ns_wide,
30a705
                     ns_cmd_prefix + "netstat -s",
30a705
-                    ns_cmd_prefix + "netstat %s -agn" % self.ns_wide
30a705
+                    ns_cmd_prefix + "netstat %s -agn" % self.ns_wide,
30a705
+                    ns_cmd_prefix + "bpftool net list",
30a705
                 ])
30a705
 
30a705
                 ss_cmd = ns_cmd_prefix + "ss -peaonmi"