add code profile support and view switch in cpu profiler#1
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| _dataNotifier.value = cpuProfileStore | ||
| .lookupProfile(label: _wrapWithFilterSuffix(userTagNone)) | ||
| ?.getActive(view); | ||
| } |
There was a problem hiding this comment.
updateView ignores active user tag filter
Medium Severity
updateView always looks up the profile using userTagNone as the label, ignoring the current _userTagFilter.value. When a user has a specific user tag filter active (e.g., selected via loadDataWithTag) and then switches between function/code views, the displayed data will incorrectly revert to the unfiltered userTagNone profile instead of the currently tag-filtered profile. The lookup label needs to use _userTagFilter.value instead of the hardcoded userTagNone.
| } | ||
| } | ||
| return cpuProfiles; | ||
| } |
There was a problem hiding this comment.
Unused isCodeProfile parameter in helper method
Low Severity
The isCodeProfile parameter in _processDataHelper is declared as required but never referenced in the method body. It's computed and passed at the call site (line 280) but has no effect on processing behavior. Similarly, shouldRefreshSearchMatches is passed through but unused within this helper — it's only used back in the caller processAndSetData. These dead parameters add confusion about what the helper actually does.


Note
Medium Risk
Touches core CPU profiling data flow and VM service interactions (including private fields and a changed
getCpuSamplescall), which could impact profiling correctness or caching behavior across modes.Overview
Adds code profile support alongside existing function profiles by introducing
CpuProfilePairand updating the profiler pipeline (service call, caching, filtering, processing) to carry both views and select the active one viaCpuProfilerViewType.When VM developer mode is enabled, DevTools now requests code-profile data from
getCpuSamples(_code: true), stitches private_codeStack/code metadata into samples, and exposes a newModeDropdownto switch Function/Code views; toggling VM developer mode clears incompatible cached profiles and resets the view to Function. Offline/profile import paths and performance frame selection were updated to wrap legacy single profiles as function-only pairs, and tests were adjusted/expanded for the new view switching behavior.Written by Cursor Bugbot for commit 8fa6713. This will update automatically on new commits. Configure here.