diff options
author | Pavel Moravec <pmoravec@redhat.com> | 2019-12-03 22:03:10 +0100 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2019-12-16 10:05:00 -0500 |
commit | dc6b61b468a4456556cdbc139442b24e4696d248 (patch) | |
tree | 58362b19640ceb009e05d8b289f119731a5cb4f1 | |
parent | 018190134e2347e8231549569826ef804d8b6285 (diff) | |
download | sos-dc6b61b468a4456556cdbc139442b24e4696d248.tar.gz |
[kernel,networking] collect bpftool net list for each namespace
- move "bpftool net list" command execution from kernel to networking
plugin as it belongs rather to networking.
- collect that output per each net name space as well
Resolves: #1874
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/plugins/kernel.py | 4 | ||||
-rw-r--r-- | sos/plugins/networking.py | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sos/plugins/kernel.py b/sos/plugins/kernel.py index 5c852143..8224e5c0 100644 --- a/sos/plugins/kernel.py +++ b/sos/plugins/kernel.py @@ -143,10 +143,6 @@ class Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): if not self.get_option("trace"): self.add_forbidden_path("/sys/kernel/debug/tracing/trace") - # collect list of bpf program attachments in the kernel - # networking subsystem - self.add_cmd_output("bpftool net list") - # collect list of eBPF programs and maps and their dumps prog_file = self.exec_cmd("bpftool -j prog list") for prog_id in self.get_bpftool_prog_ids(prog_file): diff --git a/sos/plugins/networking.py b/sos/plugins/networking.py index 2f655042..0026cda9 100644 --- a/sos/plugins/networking.py +++ b/sos/plugins/networking.py @@ -191,6 +191,10 @@ class Networking(Plugin): if self.get_option("traceroute"): self.add_cmd_output("/bin/traceroute -n %s" % self.trace_host) + # collect list of bpf program attachments in the kernel + # networking subsystem + self.add_cmd_output("bpftool net list") + # Capture additional data from namespaces; each command is run # per-namespace. ip_netns = self.exec_cmd("ip netns") @@ -212,7 +216,8 @@ class Networking(Plugin): ns_cmd_prefix + "iptables-save", ns_cmd_prefix + "netstat %s -neopa" % self.ns_wide, ns_cmd_prefix + "netstat -s", - ns_cmd_prefix + "netstat %s -agn" % self.ns_wide + ns_cmd_prefix + "netstat %s -agn" % self.ns_wide, + ns_cmd_prefix + "bpftool net list", ]) ss_cmd = ns_cmd_prefix + "ss -peaonmi" |