From 9fa8b11b767429f11c173352ffa506164b193f1c Mon Sep 17 00:00:00 2001 From: Leon Hwang Date: Fri, 6 Dec 2024 21:22:16 +0800 Subject: [PATCH] bpflbr: Skip tracing bpf progs Tracing bpf progs, like `fentry` and `fexit`, are not allowed to be traced by `fentry` or `fexit` again. Signed-off-by: Leon Hwang --- internal/bpflbr/bpf_tracing_info.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/bpflbr/bpf_tracing_info.go b/internal/bpflbr/bpf_tracing_info.go index 436b1da..d13ff90 100644 --- a/internal/bpflbr/bpf_tracing_info.go +++ b/internal/bpflbr/bpf_tracing_info.go @@ -15,6 +15,10 @@ type bpfTracingInfo struct { } func (p *bpfProgs) addTracing(id ebpf.ProgramID, funcName string, prog *ebpf.Program) error { + if prog.Type() == ebpf.Tracing { + return nil + } + key := fmt.Sprintf("%d:%s", id, funcName) if _, ok := p.tracings[key]; ok { return nil