felixge / traceutils

Code for decoding and encoding runtime/trace files as well as useful functionality implemented on top.
MIT License
85 stars 6 forks source link

Filtering possibilities #2

Open rumyantseva opened 1 year ago

rumyantseva commented 1 year ago

Hey Felix,

Thank you so much for this tool, it is so handy!

Currently, I'm trying to overcome a problem of go tool trace visualizer for user-defined tasks and regions, which is sometimes too slow (and the browser can't process it). We had an idea to filter out everything but tasks and regions, so there is fewer data to visualize.

Based on your tool, I was trying to come up with some "filtering" and leave as fewer events as possible - https://github.com/rumyantseva/traceutils/blob/filter/cmd/traceutils/filter.go & https://github.com/rumyantseva/traceutils/blob/filter/pkg/filter/filter.go. My current approach is too naive as things like encoding.EventString need to be handled more carefully, and there are some other hierarchical events that need proper handling.

So, I'm trying to find some documentation or articles to understand the relations between different events, but it doesn't seem to be super straightforward. If you have a moment, could you recommend some sources to learn from, please?

Thank you!

felixge commented 1 year ago

Hey Elena,

good to hear from you again 😊.

Hey Felix,

Thank you so much for this tool, it is so handy!

Currently, I'm trying to overcome a problem of go tool trace visualizer for user-defined tasks and regions, which is sometimes too slow (and the browser can't process it). We had an idea to filter out everything but tasks and regions, so there is fewer data to visualize.

Based on your tool, I was trying to come up with some "filtering" and leave as fewer events as possible - https://github.com/rumyantseva/traceutils/blob/filter/cmd/traceutils/filter.go & https://github.com/rumyantseva/traceutils/blob/filter/pkg/filter/filter.go. My current approach is too naive as things like encoding.EventString need to be handled more carefully, and there are some other hierarchical events that need proper handling.

This is actually something my team and I are very interested in as well. I'll send you a separate e-mail about this.

So, I'm trying to find some documentation or articles to understand the relations between different events, but it doesn't seem to be super straightforward. If you have a moment, could you recommend some sources to learn from, please?

Unfortunately I don't have a lot of good resources to point you to. The trace internals are largely undocumented. Everything I know comes from studying the source, in particular: