From c13cd2234e670418d454a8e2f20324474266d6ff Mon Sep 17 00:00:00 2001 From: Vimal Kumar Date: Mon, 13 May 2024 20:03:20 +0530 Subject: [PATCH] fix(must-gather): user bpftool to get ebpf related info Signed-off-by: Vimal Kumar --- must-gather/gather | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/must-gather/gather b/must-gather/gather index bde4a8e5..87c415b0 100755 --- a/must-gather/gather +++ b/must-gather/gather @@ -210,9 +210,18 @@ get_kepler_ebpf_info() { local kepler_node_info_dir="$2" shift 2 log "getting ebpf information from kepler pod: $kepler_pod" - echo "## kprobes list only applicable for bcc" >>"$kepler_node_info_dir/ebpf-info" - echo "kprobes list:" >>"$kepler_node_info_dir/ebpf-info" - run oc -n "$KEPLER_NS" exec "$kepler_pod" -c kepler -- cat /sys/kernel/debug/kprobes/list "$kepler_node_info_dir/ebpf-info" + + echo "Probing the running kernel and dumping the number of eBPF-related parameters" + echo "ebpf related features supported by current kernel:" >>"$kepler_node_info_dir/kernel-ebpf-features" + run oc -n "$KEPLER_NS" exec "$kepler_pod" -c kepler -- bpftool feature probe kernel "$kepler_node_info_dir/ebpf-features" + + echo "listing all loaded ebpf programs" + echo "list of all loaded ebpf programs:" >>"$kepler_node_info_dir/ebpf-info" + run oc -n "$KEPLER_NS" exec "$kepler_pod" -c kepler -- bpftool prog list "$kepler_node_info_dir/ebpf-info" + + echo "listing all ebpf maps" + echo "list of all ebpf maps:" >>"$kepler_node_info_dir/ebpf-info" + run oc -n "$KEPLER_NS" exec "$kepler_pod" -c kepler -- bpftool map list "$kepler_node_info_dir/ebpf-info" } get_kepler_logs() {