-
Notifications
You must be signed in to change notification settings - Fork 34.4k
Runtime debugging
Robo edited this page Aug 14, 2025
·
2 revisions
When a window (renderer process) is unresponsive the devtools might be unable to collect the required cpu profile. A reliable way to profile in such cases is with the tracing infra using the steps below,
- Restart VS Code with the following flags
--trace --trace-category-filter="renderer,blink,v8,disabled-by-default-v8.cpu_profiler"
- Once the unresponsive dialog pop ups, click on the
Reopen
button - In the new window, execute "F1 > Developer: Stop Tracing"
This will generate a trace json file which can be loaded into any of the following clients that supports the Google's Trace Event format
- chrome://tracing in any chromium browser
- ui.perfetto.dev
- Firefox profiler
If you have an unsigned build of VSCode, then samply can be used to capture both JIT and native traces
- Download the latest release of https://github.com/mstange/samply/releases
- Start from the command line with following
samply.exe record -s -o profile.json.gz --browsers -- <path>/Visual\ Studio\ Code.app/Contents/MacOS/Electron --js-flags="--perf-basic-prof --perf-prof-unwinding-info --interpreted-frames-native-stack"
- Perform the steps for unresponsiveness or slow startups etc
- Exit the application and the profile will be saved to
profile.json.gz
You can inspect the profile with samply.exe load --breakpad-symbol-dir <path> profile.json.gz
- Open
Windows Performance Recorder
from System start menu, it is not installed by default. You can install it via Windows Assessment and Deployment Kit (ADK) and chooseWindows Performance Toolkit
. - Select the following options under
Resource Analysis
- CPU Usage
- File I/O activity
- Pool usage
- VirtualAlloc usage
- Set
Performance Scenario
toGeneral
,Detail level
toverbose
andLogging mode
tofile
- Start the recorder
- Start the VSCode application from the terminal with the following additional flags
--js-flags="--enable-etw-stack-walking --interpreted-frames-native-stack"
- Perform the actions that trigger the issue (slow startups, out of memory, unresponsive threads etc)
- Stop the recorder and save the file
The .etl
file should not be attached to public issues since they contain PII and only shared via trusted channels.
Project Management
- Roadmap
- Iteration Plans
- Development Process
- Issue Tracking
- Build Champion
- Release Process
- Running the Endgame
- Related Projects
Contributing
- How to Contribute
- Submitting Bugs and Suggestions
- Feedback Channels
- Source Code Organization
- Coding Guidelines
- Testing
- Dealing with Test Flakiness
- Contributor License Agreement
- Extension API Guidelines
- Accessibility Guidelines
Documentation