From 478767cbda45e79c7d1c9efb30aa405f871126c5 Mon Sep 17 00:00:00 2001 From: Frederic Branczyk Date: Fri, 25 Aug 2023 11:27:56 +0200 Subject: [PATCH] pkg/query: Fix how inlined functions are determined to be root --- pkg/query/flamegraph_arrow.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/query/flamegraph_arrow.go b/pkg/query/flamegraph_arrow.go index 1274cbb708d..4ab5e4d9949 100644 --- a/pkg/query/flamegraph_arrow.go +++ b/pkg/query/flamegraph_arrow.go @@ -228,6 +228,8 @@ func generateFlamegraphArrowRecord(ctx context.Context, mem memory.Allocator, tr stacktraces: // just like locations, pprof stores lines in reverse order. for k := int(llOffsetEnd - 1); k >= int(llOffsetStart); k-- { + isRoot = isLocationRoot && !(aggregateLabels && len(sampleLabels) > 0) && k == int(llOffsetEnd-1) + // We only want to compare the rows if this is the root, and we don't aggregate the labels. if isRoot { fb.compareRows = copyChildren(fb.compareRows, fb.rootsRow[unsafeString(lsbytes)])