From a1eb580aa5b80e913dc722ccf97e42c6987152e8 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 23 Feb 2026 10:34:37 +0200 Subject: Add getcwd tracing support and stabilize comm propagation test --- internal/eventloop.go | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'internal/eventloop.go') diff --git a/internal/eventloop.go b/internal/eventloop.go index c9151d6..f4f7a7c 100644 --- a/internal/eventloop.go +++ b/internal/eventloop.go @@ -393,6 +393,17 @@ func (e *eventLoop) tracepointExited(exitEv event.Event, ch chan<- *event.Pair) ep.File = fdFile } } + if ep.Is(SYS_ENTER_GETCWD) { + retEvent, ok := ep.ExitEv.(*types.RetEvent) + if !ok { + panic("expected *types.RetEvent") + } + if retEvent.Ret > 0 { + if cwd, err := os.Readlink(fmt.Sprintf("/proc/%d/cwd", ep.EnterEv.GetTid())); err == nil { + ep.File = file.NewPathname([]byte(cwd)) + } + } + } ep.Comm = e.comm(ep.EnterEv.GetTid()) if !e.filter.eventPair(ep) { ep.Recycle() -- cgit v1.2.3