From 55678b4d3b19cc9cbfe3cadc7a829ed4ea18330c 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. --- 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 e423c2be47..d1288710e4 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++ }