summaryrefslogtreecommitdiff
path: root/internal/flamegraph/livetrie.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/flamegraph/livetrie.go')
-rw-r--r--internal/flamegraph/livetrie.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/flamegraph/livetrie.go b/internal/flamegraph/livetrie.go
index a510a72..47299e6 100644
--- a/internal/flamegraph/livetrie.go
+++ b/internal/flamegraph/livetrie.go
@@ -102,19 +102,22 @@ func (lt *LiveTrie) Ingest(ep *event.Pair) {
// AddRecord adds one already-decoded flamegraph record into the live trie.
func (lt *LiveTrie) AddRecord(record IterRecord) {
+ lt.mu.Lock()
+
value, err := record.Cnt.ValueByName(lt.countField)
if err != nil {
+ lt.mu.Unlock()
return
}
heightValue := uint64(0)
if lt.heightField != "" {
heightValue, err = record.Cnt.ValueByName(lt.heightField)
if err != nil {
+ lt.mu.Unlock()
return
}
}
- lt.mu.Lock()
frames := lt.buildFrames(record)
lt.addLocked(frames, value, heightValue)
lt.version.Add(1)