Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add code profile support and view switch in cpu profiler#1

Open
oliver-1999 wants to merge 1 commit intobase-cpu-profiler-code-view-r-11722390from
oliver-1999/cpu-profiler-code-view-r-11722390
Open

add code profile support and view switch in cpu profiler#1
oliver-1999 wants to merge 1 commit intobase-cpu-profiler-code-view-r-11722390from
oliver-1999/cpu-profiler-code-view-r-11722390

Conversation

@oliver-1999
Copy link

@oliver-1999 oliver-1999 commented Feb 18, 2026

Note

Medium Risk
Touches core CPU profiling data flow and VM service interactions (including private fields and a changed getCpuSamples call), which could impact profiling correctness or caching behavior across modes.

Overview
Adds code profile support alongside existing function profiles by introducing CpuProfilePair and updating the profiler pipeline (service call, caching, filtering, processing) to carry both views and select the active one via CpuProfilerViewType.

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 new ModeDropdown to 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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

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);
}
Copy link

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

}
}
return cpuProfiles;
}
Copy link

Choose a reason for hiding this comment

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

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.

Fix in Cursor Fix in Web

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.

1 participant