Skip to content

Commit 464c52b

Browse files
authored
Handling non-symbolized frames properly for flamecharts (#6143)
1 parent 4b33fd7 commit 464c52b

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

pkg/query/flamegraph_arrow.go

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,11 +1400,26 @@ func (fb *flamegraphBuilder) appendRow(
14001400
// something has already gone terribly wrong.
14011401
fb.builderLocationLine.Append(r.LineNumber.Value(lineRow))
14021402

1403-
if r.LineFunctionNameIndices.IsValid(lineRow) && t.functionSystemName.indices.Len() > 0 {
1403+
if r.LineFunctionNameIndices.IsValid(lineRow) {
14041404
fb.builderFunctionStartLine.Append(r.LineFunctionStartLine.Value(lineRow))
1405-
fb.builderFunctionNameIndices.Append(t.functionName.indices.Value(int(r.LineFunctionNameIndices.Value(lineRow))))
1406-
fb.builderFunctionSystemNameIndices.Append(t.functionSystemName.indices.Value(int(r.LineFunctionSystemNameIndices.Value(lineRow))))
1407-
fb.builderFunctionFilenameIndices.Append(t.functionFilename.indices.Value(int(r.LineFunctionFilenameIndices.Value(lineRow))))
1405+
1406+
if t.functionName.indices.Len() > 0 {
1407+
fb.builderFunctionNameIndices.Append(t.functionName.indices.Value(int(r.LineFunctionNameIndices.Value(lineRow))))
1408+
} else {
1409+
fb.builderFunctionNameIndices.AppendNull()
1410+
}
1411+
1412+
if t.functionSystemName.indices.Len() > 0 {
1413+
fb.builderFunctionSystemNameIndices.Append(t.functionSystemName.indices.Value(int(r.LineFunctionSystemNameIndices.Value(lineRow))))
1414+
} else {
1415+
fb.builderFunctionSystemNameIndices.AppendNull()
1416+
}
1417+
1418+
if t.functionFilename.indices.Len() > 0 {
1419+
fb.builderFunctionFilenameIndices.Append(t.functionFilename.indices.Value(int(r.LineFunctionFilenameIndices.Value(lineRow))))
1420+
} else {
1421+
fb.builderFunctionFilenameIndices.AppendNull()
1422+
}
14081423
} else {
14091424
fb.builderFunctionStartLine.AppendNull()
14101425
fb.builderFunctionNameIndices.AppendNull()

0 commit comments

Comments
 (0)