Skip to content

Commit a2ee03d

Browse files
committed
perf(symbolizer): Optimize stack enrichment
Except when the LoadImage event is emitted by the System process, all other events are safe to ignore callstack symbolization.
1 parent c551de7 commit a2ee03d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/symbolize/symbolizer.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,15 @@ func (s *Symbolizer) syncModules(e *kevent.Kevent) error {
285285
func (s *Symbolizer) processCallstack(e *kevent.Kevent) error {
286286
addrs := e.Kparams.MustGetSliceAddrs(kparams.Callstack)
287287
e.Callstack.Init(len(addrs))
288-
if (e.IsCreateFile() && e.IsOpenDisposition()) || (e.IsSystemPid() && !e.IsLoadImage()) {
288+
289+
// skip stack enrichment for the events generated by the System process
290+
// except the LoadImage event which may prove to be useful when the driver
291+
// is loaded and the kernel address symbolization is enabled
292+
if e.IsSystemPid() && !e.IsLoadImage() {
293+
return nil
294+
}
295+
296+
if e.IsCreateFile() && e.IsOpenDisposition() {
289297
// for high-volume events decorating
290298
// the frames with symbol information
291299
// is not viable. For this reason, the

0 commit comments

Comments
 (0)