summaryrefslogtreecommitdiff
path: root/internal/eventloop.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-06 16:49:36 +0200
committerPaul Buetow <paul@buetow.org>2026-03-06 16:49:36 +0200
commit765f4cc72c99b821f68c0108bb65aa26696b7849 (patch)
tree9fcafc0a766363bb45cc0c2eaf990cb75d4135f4 /internal/eventloop.go
parent675f6d544e62a656581408b7dbefa2e7a4d5c92a (diff)
refactor: use pointer receivers for FdFile consistently (task 382)
Diffstat (limited to 'internal/eventloop.go')
-rw-r--r--internal/eventloop.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/eventloop.go b/internal/eventloop.go
index 8e336a2..26eaafc 100644
--- a/internal/eventloop.go
+++ b/internal/eventloop.go
@@ -211,7 +211,7 @@ type eventLoop struct {
enterEvs map[uint32]*event.Pair // Temp. store of sys_enter tracepoints per Tid.
pendingHandles map[uint32]string // map of TID to pathname from name_to_handle_at
fdTracker *fdTracker
- procFdCache map[uint64]file.FdFile // Cache procfs-resolved metadata for unknown fds.
+ procFdCache map[uint64]*file.FdFile // Cache procfs-resolved metadata for unknown fds.
commResolver *commResolver
prevPairTimes map[uint32]uint64 // Previous event's time (to calculate time differences between two events)
rawHandlers map[types.EventType]rawEventHandler
@@ -242,7 +242,7 @@ func newEventLoop(cfg eventLoopConfig) (*eventLoop, error) {
enterEvs: make(map[uint32]*event.Pair),
pendingHandles: make(map[uint32]string),
fdTracker: fdState,
- procFdCache: make(map[uint64]file.FdFile),
+ procFdCache: make(map[uint64]*file.FdFile),
commResolver: commState,
prevPairTimes: make(map[uint32]uint64),
rawHandlers: make(map[types.EventType]rawEventHandler),
@@ -668,7 +668,7 @@ func (e *eventLoop) handleFdExit(ep *event.Pair, fdEv *types.FdEvent) bool {
}
if ep.Is(types.SYS_ENTER_DUP) || ep.Is(types.SYS_ENTER_DUP2) {
- fdFile, ok := ep.File.(file.FdFile)
+ fdFile, ok := ep.File.(*file.FdFile)
if !ok {
e.recyclePair(ep, "Dropped malformed dup source event")
return false
@@ -708,7 +708,7 @@ func (e *eventLoop) handleDup3Exit(ep *event.Pair, dup3Ev *types.Dup3Event) bool
return false
}
- fdFile, ok := ep.File.(file.FdFile)
+ fdFile, ok := ep.File.(*file.FdFile)
if !ok {
e.recyclePair(ep, "Dropped malformed dup3 source event")
return false
@@ -805,7 +805,7 @@ func (e *eventLoop) handleFcntlExit(ep *event.Pair, fcntlEv *types.FcntlEvent) b
return true
}
- fdFile, ok := ep.File.(file.FdFile)
+ fdFile, ok := ep.File.(*file.FdFile)
if !ok {
e.recyclePair(ep, "Dropped malformed fcntl file event")
return false
@@ -826,7 +826,7 @@ func (e *eventLoop) handleFcntlExit(ep *event.Pair, fcntlEv *types.FcntlEvent) b
return true
}
-func (e *eventLoop) registerDup(fdFile file.FdFile, newFd int32, extraFlags int32) {
+func (e *eventLoop) registerDup(fdFile *file.FdFile, newFd int32, extraFlags int32) {
if newFd < 0 {
return
}
@@ -867,12 +867,12 @@ func (e *eventLoop) resolveFdFile(fd int32, pid uint32) file.File {
return discovered
}
-func (e *eventLoop) cachedProcFdFile(fd int32, pid uint32) (file.FdFile, bool) {
+func (e *eventLoop) cachedProcFdFile(fd int32, pid uint32) (*file.FdFile, bool) {
cache, ok := e.procFdCacheState()[procFdCacheKey(pid, fd)]
return cache, ok
}
-func (e *eventLoop) setProcFdCache(fd int32, pid uint32, resolved file.FdFile) {
+func (e *eventLoop) setProcFdCache(fd int32, pid uint32, resolved *file.FdFile) {
e.procFdCacheState()[procFdCacheKey(pid, fd)] = resolved
}
@@ -891,9 +891,9 @@ func (e *eventLoop) deleteProcFdCacheFrom(first int32, pid uint32) {
}
}
-func (e *eventLoop) procFdCacheState() map[uint64]file.FdFile {
+func (e *eventLoop) procFdCacheState() map[uint64]*file.FdFile {
if e.procFdCache == nil {
- e.procFdCache = make(map[uint64]file.FdFile)
+ e.procFdCache = make(map[uint64]*file.FdFile)
}
return e.procFdCache
}