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

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