From 0a8827d0514c48b9e876319373653c96164a77d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gustavo=20I=C3=B1iguez=20Goia?= Date: Fri, 26 Jan 2024 14:48:44 +0100 Subject: [PATCH] added more debug info to the dns ebpf hook Added the path to the libc as well as the calculated offset for the uprobe. Don't return on the first error found loading a uprobe, instead try all the uprobes and return if the loaded uprobes are 0. (cherry picked from commit 55678b4d3b19cc9cbfe3cadc7a829ed4ea18330c) --- daemon/dns/ebpfhook.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daemon/dns/ebpfhook.go b/daemon/dns/ebpfhook.go index ae470b9915..b91dcf8c95 100644 --- a/daemon/dns/ebpfhook.go +++ b/daemon/dns/ebpfhook.go @@ -123,13 +123,13 @@ func ListenerEbpf(ebpfModPath string) error { probeFunction = strings.Replace(probeFunction, "uprobe/", "", 1) offset, err := lookupSymbol(libcElf, probeFunction) if err != nil { - log.Warning("EBPF-DNS: Failed to find symbol for uprobe %s : %s\n", uprobe.Name, err) + log.Warning("EBPF-DNS: Failed to find symbol for uprobe %s (offset: %d): %s\n", uprobe.Name, offset, err) continue } err = bpf.AttachUprobe(uprobe, libcFile, offset) if err != nil { - log.Error("EBPF-DNS: Failed to attach uprobe %s : %s\n", uprobe.Name, err) - return err + log.Warning("EBPF-DNS: Failed to attach uprobe %s : %s, (%s, %d)\n", uprobe.Name, err, libcFile, offset) + continue } probesAttached++ }