Skip to content

Add "Include idle samples" toggle to the call tree settings#5968

Merged
canova merged 2 commits intofirefox-devtools:mainfrom
canova:toggle-idle
Apr 27, 2026
Merged

Add "Include idle samples" toggle to the call tree settings#5968
canova merged 2 commits intofirefox-devtools:mainfrom
canova:toggle-idle

Conversation

@canova
Copy link
Copy Markdown
Member

@canova canova commented Apr 24, 2026

This is the approach we wanted to go with instead of #5943, also discussed there. This PR adds a new checkbox that's called "Include idle samples" to the settings of the call tree/flame graph/stack chart.

It's visible only when we have an Idle category. It's checked by default in the web view, but can be unchecked to hide the idle samples. It will be unchecked by default in the profiler-cli though, as we think it's more important to be concise there. But it can be toggled there as well.

Here's a deploy preview

@canova canova requested a review from a team as a code owner April 24, 2026 09:13
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 24, 2026

Codecov Report

❌ Patch coverage is 89.47368% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.33%. Comparing base (a802dc1) to head (c155fdf).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/components/shared/StackSettings.tsx 78.57% 2 Missing and 1 partial ⚠️
src/components/calltree/CallTreeEmptyReasons.tsx 75.00% 1 Missing ⚠️
.../components/flame-graph/FlameGraphEmptyReasons.tsx 75.00% 1 Missing ⚠️
.../components/stack-chart/StackChartEmptyReasons.tsx 75.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5968   +/-   ##
=======================================
  Coverage   85.33%   85.33%           
=======================================
  Files         323      323           
  Lines       32214    32262   +48     
  Branches     8871     8895   +24     
=======================================
+ Hits        27490    27532   +42     
- Misses       4293     4298    +5     
- Partials      431      432    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@canova canova requested a review from mstange April 24, 2026 09:17
@mstange
Copy link
Copy Markdown
Contributor

mstange commented Apr 24, 2026

Placing it before
transforms means the filter uses the sample's recorded leaf category
(collapse transforms can change which frame is the leaf).

The derived SamplesTable has its own category column these days, and it's unaffected by transforms (it's what we use for the activity graph) so you should probably use it, and you could even move the Idle sample filtering later in the pipeline. That might make it easier in the future to cache / share more work across threads.

Copy link
Copy Markdown
Contributor

@mstange mstange left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good except for where it slots in in the pipeline and the fact that it doesn't use samples.category. Feel free to re-request review if you want me to take another look after the changes but I don't actually think another review is needed

@canova
Copy link
Copy Markdown
Member Author

canova commented Apr 27, 2026

Ah I completely forgot that we have the category in the derived samples table now! Moved the idle samples filtering to after the transforms in the timeline. But as we discussed in Matrix, I think it's better to do it before the implementation filter step, so I moved it in between transform and implementation filter steps. Thanks!

canova added 2 commits April 27, 2026 11:18
Adds a checkbox next to "Invert call stack" in the call tree, flame
graph, and stack chart settings. It is on by default, and when
unchecked, samples whose leaf frame is in the Idle category are hidden
from the call tree and related views by nulling out their sample.stack
entry. The checkbox is only rendered when the profile actually has an
"Idle" category.

Implemented as a new step in the per-thread filter pipeline, sitting
between the transforms and the implementation filter. Since we use the
category column that belongs to the derived samples table, we don't need
to worry about transforms changing the stack table.
Ideally they should be localized, but apparently they weren't. So let's
keep it like this for now, and we can localize these as a follow-up.
@canova canova merged commit 1a053b9 into firefox-devtools:main Apr 27, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants