summaryrefslogtreecommitdiff
path: root/internal/flags/flags.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-26 22:59:16 +0200
committerPaul Buetow <paul@buetow.org>2026-02-26 22:59:16 +0200
commitdc7478d7dadf544787a9718608f11312bd2ea944 (patch)
treedc445798ab132e08d8885672fcca0a37facd25ea /internal/flags/flags.go
parent39a11ed5997a3829751dfbe4b666d3568d466276 (diff)
tui: revamp status keys and add pid/tid reselection flow
Diffstat (limited to 'internal/flags/flags.go')
-rw-r--r--internal/flags/flags.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/internal/flags/flags.go b/internal/flags/flags.go
index 4dd32cc..6eafa5e 100644
--- a/internal/flags/flags.go
+++ b/internal/flags/flags.go
@@ -19,10 +19,13 @@ var (
}
once sync.Once
pidFilter atomic.Int64
+ tidFilter atomic.Int64
tuiExportEnable atomic.Bool
)
func init() {
+ pidFilter.Store(-1)
+ tidFilter.Store(-1)
tuiExportEnable.Store(true)
}
@@ -72,6 +75,7 @@ type Flags struct {
func Get() Flags {
out := singleton
out.PidFilter = int(pidFilter.Load())
+ out.TidFilter = int(tidFilter.Load())
out.TUIExportEnable = tuiExportEnable.Load()
return out
}
@@ -81,6 +85,11 @@ func SetPidFilter(pid int) {
pidFilter.Store(int64(pid))
}
+// SetTidFilter updates the active TID filter used for subsequent tracing runs.
+func SetTidFilter(tid int) {
+ tidFilter.Store(int64(tid))
+}
+
// SetTUIExportEnable toggles TUI snapshot export file writing.
func SetTUIExportEnable(enabled bool) {
tuiExportEnable.Store(enabled)
@@ -118,6 +127,7 @@ func parse() {
fmt.Sprintf("Count field to collapse, valid are: %v", validCollapsedCounts))
flag.Parse()
pidFilter.Store(int64(singleton.PidFilter))
+ tidFilter.Store(int64(singleton.TidFilter))
tuiExportEnable.Store(singleton.TUIExportEnable)
singleton.TracepointsToAttach = extractTracepointFlags(*tracepointsToAttach)