Skip to content

Commit 9a25aab

Browse files
authored
pkg/profiler/cpu: Fix noop due to value struct (#1874)
This caused any process to only report on a single thread per profile cycle, which resulted in incorrect profiling data. ### Test Main (only single thread stack traces per profile) : ![CleanShot_2023-07-20_at_09 55 21](https://github.com/parca-dev/parca-agent/assets/536449/8ea317d2-981f-4d7e-b137-b1c4ed3acf83) ![CleanShot_2023-07-20_at_09 55 44](https://github.com/parca-dev/parca-agent/assets/536449/a8e9aa03-ffe7-4ecd-b975-d1dd8d3804b3) Patch (multiple thread stack traces per profile): ![CleanShot_2023-07-20_at_09 57 42](https://github.com/parca-dev/parca-agent/assets/536449/d9be5b5c-efaf-401a-b001-a3e5abed4c5b) ![CleanShot_2023-07-20_at_09 57 29](https://github.com/parca-dev/parca-agent/assets/536449/2b1617f3-dbb0-4846-8d47-2e94164bb3a7)
2 parents 6ed4ec5 + 3568682 commit 9a25aab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pkg/profiler/cpu/cpu.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,11 @@ func (p *CPU) Run(ctx context.Context) error {
629629
}
630630
continue
631631
}
632-
data.RawSamples = append(data.RawSamples, perThreadRawData.RawSamples...)
632+
633+
groupedRawData[pid] = profile.ProcessRawData{
634+
PID: perThreadRawData.PID,
635+
RawSamples: append(data.RawSamples, perThreadRawData.RawSamples...),
636+
}
633637
}
634638

635639
processLastErrors := map[int]error{}

0 commit comments

Comments
 (0)