-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix(explorer): better profile thread selection logic #103656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
| ) | ||
| show_all_frames = ( | ||
| True # Show all frames including system frames when no in_app frames exist | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: MainThread selection ignores whether thread has samples
When no threads have in_app frames, the code attempts to select MainThread from metadata without verifying it actually contains any samples. If MainThread exists in metadata but never appears in the samples data, selected_thread_id will be set to a thread that has no profiling data, causing all samples to be skipped and an empty execution tree to be returned instead of falling back to the first sample's thread.
JoshFerge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious what the logic is on issue details for this, but makes sense to me
From dogfooding in the UI, it doesn't seem like there is any consistent logic besides selecting the first available thread, which isn't a great UX... |
Instead of just selecting the thread from the first sample, we now prioritize the thread with the most in-app frames. And if no in-app frames are present, we show system frames.