From e9e00ffd5e6b0657931b244275adfb3ca7cd47e2 Mon Sep 17 00:00:00 2001 From: Dean Sheather Date: Fri, 12 Apr 2024 07:20:30 +0000 Subject: [PATCH] fixup! feat: send logs to userspace + revamp --- .gitattributes | 12 ++++++------ enterprise/exectrace.go | 3 +++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitattributes b/.gitattributes index e4d2e59..e9d4bb7 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,6 @@ -bpf/bpf_core_read.h linguist-vendored -bpf/bpf_helper_defs.h linguist-vendored -bpf/bpf_helpers.h linguist-vendored -bpf/handler-bpfeb.o linguist-generated -bpf/handler-bpfel.o linguist-generated -bpf/vmlinux.h linguist-vendored +bpf/bpf_core_read.h linguist-generated=true +bpf/bpf_helper_defs.h linguist-generated=true +bpf/bpf_helpers.h linguist-generated=true +bpf/handler-bpfeb.o linguist-generated=true +bpf/handler-bpfel.o linguist-generated=true +bpf/vmlinux.h linguist-generated=true diff --git a/enterprise/exectrace.go b/enterprise/exectrace.go index b47b63b..d5088cf 100644 --- a/enterprise/exectrace.go +++ b/enterprise/exectrace.go @@ -81,6 +81,9 @@ func Run(ctx context.Context, log slog.Logger, opts Options) error { log.Debug(ctx, "starting tracer") tracer, err := exectrace.New(&exectrace.TracerOpts{ PidNS: pidNS, + LogFn: func(uid, gid, pid uint32, logLine string) { + log.Error(ctx, "tracer error log: "+logLine, slog.F("uid", uid), slog.F("gid", gid), slog.F("pid", pid)) + }, }) if err != nil { return xerrors.Errorf("create tracer: %w", err)