diff options
| author | Paul Buetow <paul@buetow.org> | 2025-03-14 23:41:54 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-03-14 23:41:54 +0200 |
| commit | 5cac6a84181a6121e27c5c763a3e34254180fa4b (patch) | |
| tree | 83bf76348990052452d38d3feacc20f757b27695 /internal/eventloop.go | |
| parent | 3edde70ef17d23a3f2fcb0fac11a50e8810ab943 (diff) | |
parallel rite collapsed flamegraphs
Diffstat (limited to 'internal/eventloop.go')
| -rw-r--r-- | internal/eventloop.go | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/internal/eventloop.go b/internal/eventloop.go index 1e7fea6..11a184d 100644 --- a/internal/eventloop.go +++ b/internal/eventloop.go @@ -3,7 +3,6 @@ package internal import "C" import ( - "bytes" "context" "fmt" "os" @@ -181,9 +180,7 @@ func (e *eventLoop) syscallExit(exitEv event.Event, ch chan<- *event.Pair) { fd := int32(ev.ExitEv.(*RetEvent).Ret) // It's from an array, so only create string from array until first 0 byte // TODO: This could speed up the path filter as well - // TODO: Hopefully, this won't cause a panic when the filename is as long as the array itself - filePath := string(openEv.Filename[:bytes.IndexByte(openEv.Filename[:], 0)]) - file := file.NewFd(fd, filePath) + file := file.NewFd(fd, openEv.Filename[:]) if fd >= 0 { e.files[fd] = file } @@ -192,15 +189,12 @@ func (e *eventLoop) syscallExit(exitEv event.Event, ch chan<- *event.Pair) { case *NameEvent: nameEvent := ev.EnterEv.(*NameEvent) - ev.File = file.OldnameNewnameFile{ - Oldname: string(nameEvent.Oldname[:]), - Newname: string(nameEvent.Newname[:]), - } + ev.File = file.NewOldnameNewname(nameEvent.Oldname[:], nameEvent.Newname[:]) ev.Comm = e.comm(ev.EnterEv.GetTid()) case *PathEvent: nameEvent := ev.EnterEv.(*PathEvent) - ev.File = file.PathnameFile{Pathname: string(nameEvent.Pathname[:])} + ev.File = file.NewPathname(nameEvent.Pathname[:]) ev.Comm = e.comm(ev.EnterEv.GetTid()) case *FdEvent: |
