summaryrefslogtreecommitdiff
path: root/internal/flamegraph/livetrie.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-06 16:04:43 +0200
committerPaul Buetow <paul@buetow.org>2026-03-06 16:04:43 +0200
commitcc4edee087143d656fc74067297f3f540b61362e (patch)
tree7bd4b8bf841037b2fb19779d52cff6219c4fa070 /internal/flamegraph/livetrie.go
parenta2d253f1e92578ccea95f962bbd1a1aebf190de1 (diff)
refactor: share collapse field validation lists (task 387)
Diffstat (limited to 'internal/flamegraph/livetrie.go')
-rw-r--r--internal/flamegraph/livetrie.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/internal/flamegraph/livetrie.go b/internal/flamegraph/livetrie.go
index 9f1fd91..04137bf 100644
--- a/internal/flamegraph/livetrie.go
+++ b/internal/flamegraph/livetrie.go
@@ -9,6 +9,7 @@ import (
"sync"
"sync/atomic"
+ "ior/internal/collapse"
"ior/internal/event"
)
@@ -261,21 +262,11 @@ func normalizeLiveTrieFields(fields []string) ([]string, error) {
}
func isLiveTrieField(field string) bool {
- switch field {
- case "path", "comm", "tracepoint", "pid", "tid", "flags":
- return true
- default:
- return false
- }
+ return collapse.IsValidField(field)
}
func isLiveTrieCountField(field string) bool {
- switch field {
- case "count", "duration", "durationToPrev", "bytes":
- return true
- default:
- return false
- }
+ return collapse.IsValidCountField(field)
}
func subtreeTotal(node *trieNode) uint64 {