diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-01 23:45:37 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-01 23:45:37 +0200 |
| commit | 5775246cb9c2ccfb3469addf6f5fe9a8fc198171 (patch) | |
| tree | 96290d1bede538c9fd352bc3954bac1ce8ab6873 /internal/eventloop.go | |
| parent | 3b4be9171b7ca13d4ff3e51d14c4e569b1a308f7 (diff) | |
Thread runtime config instead of global flags reads
Diffstat (limited to 'internal/eventloop.go')
| -rw-r--r-- | internal/eventloop.go | 7 |
1 files changed, 5 insertions, 2 deletions
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{}), } |
