From 5775246cb9c2ccfb3469addf6f5fe9a8fc198171 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sun, 1 Mar 2026 23:45:37 +0200 Subject: Thread runtime config instead of global flags reads --- internal/eventloop.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'internal/eventloop.go') diff --git a/internal/eventloop.go b/internal/eventloop.go index 62ab148..6975df3 100644 --- a/internal/eventloop.go +++ b/internal/eventloop.go @@ -22,10 +22,13 @@ const sysEnterNameToHandleAtName = "name_to_handle_at" type eventLoopConfig struct { pidFilter int + commFilter string + pathFilter string liveFlamegraph bool liveInterval time.Duration collapsedFields []string countField string + flamegraphName string flamegraphEnable bool pprofEnable bool plainMode bool @@ -61,7 +64,7 @@ type eventLoop struct { func newEventLoop(cfg eventLoopConfig) *eventLoop { el := &eventLoop{ - filter: newEventFilter(), + filter: newEventFilter(cfg.commFilter, cfg.pathFilter), enterEvs: make(map[uint32]*event.Pair), pendingHandles: make(map[uint32]string), files: make(map[int32]file.File), @@ -70,7 +73,7 @@ func newEventLoop(cfg eventLoopConfig) *eventLoop { prevPairTimes: make(map[uint32]uint64), rawHandlers: make(map[EventType]rawEventHandler), printCb: func(ep *event.Pair) { fmt.Println(ep); ep.Recycle() }, - flamegraph: flamegraph.New(), + flamegraph: flamegraph.New(cfg.flamegraphName), cfg: cfg, done: make(chan struct{}), } -- cgit v1.2.3