dominikh / gotraceui

Go execution trace frontend
https://gotraceui.dev
MIT License
1.13k stars 27 forks source link

Detect common patterns from stack traces #3

Open dominikh opened 2 years ago

dominikh commented 2 years ago

As rich as the execution trace is, a lot of higher level events are represented as many smaller events. For example, a goroutine might block on a mutex because it tried to allocate memory and the allocation triggered a garbage collection, and starting the garbage collection needs to hold a lock.

At a glance, this just looks like user code blocking on a mutex. Only from the stack trace does it become obvious that we're blocking because of an allocation. Instead of expecting every user to be able to recognize these patterns, we should detect them and make them visible.

This might also allow us to provide more detail for the generic EvGoBlock event.

dominikh commented 2 years ago

This should be toggleable. This kind of pattern matching is designed to focus on userspace, by hiding or coalescing runtime stack frames that don't matter to people debugging their own code. However, people working on the runtime itself will very much care about these details.