Skip to content

Show Running Extension > Start Extension Host Profile button does nothing #194678

Closed
jrieken/v8-inspect-profiler
#3

Description

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.83.0-insider (Universal)
  • OS Version: Mac 13.4.1 (22F82)

Steps to Reproduce:

  1. Type Cmd-Shift-P Developer: Show Running Extension
  2. Near the top right there's a circle icon. Hovering over it shows the tooltip "Start Extension Host Profile". Click this button.

Expected:
It starts an extension host profile, turning the icon into a square. Clicking the icon again shows an extension profile, showing which extensions too the most time.

Actual:
Clicking the button does nothing.

Screen Recording 2023-10-03 at 10 27 21 AM

Activity

  1. vscodenpa commented on Oct 3, 2023

    @vscodenpa

    Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.82.3. Please try upgrading to the latest version and checking whether this issue remains.

    Happy Coding!

  2. bmalehorn commented on Oct 3, 2023

    @bmalehorn
    ContributorAuthor

    Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.82.3. Please try upgrading to the latest version and checking whether this issue remains.

    Happy Coding!

    Ok, I reproduced this with the latest insiders build & updated the PR description with my insiders version.

  3. jrieken commented on Oct 5, 2023

    @jrieken
    Contributor

    This sends the SIGUSR1 signal which on windows doesn't exist. We have or used to have an alternative for that the utility process might not support that?

  4. deepak1556 commented on Oct 5, 2023

    @deepak1556
    Collaborator

    I am unable to repro with latest insiders, can you try the following steps to narrow down the issue

    • Copy the pid of extensionHost from the process explorer
    • In system terminal, run kill -s SIGUSR1 <pid-of-extension-host>
    • In system terminal, run lsof -Pan -p <pid-of-extension-host> -i.
    • Paste the output to this issue thread
  5. added
    info-needed
    on Oct 5, 2023
  6. bmalehorn commented on Oct 9, 2023

    @bmalehorn
    ContributorAuthor

    Sure.

    Copied the pid of Code - Insiders Helper (Plugin):
    image

    Ran the above commands:

    ~ 
    ➜ kill -s SIGUSR1 80532
    
    ~ 
    ➜ lsof -Pan -p 80532 -i
    COMMAND     PID          USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
    Code\x20- 80532 brianmalehorn   43u  IPv4 0x50cd223cc3432315      0t0  TCP 127.0.0.1:57279 (LISTEN)
    
  7. deepak1556 commented on Oct 9, 2023

    @deepak1556
    Collaborator

    Great, the output indicates the process has the inspector agent started on 127.0.0.1:57279. This confirms that utility process is able to start the inspector. Now as a next step, can you help us confirm if a client is able to connect to this agent,

    • Restart VSCode
    • Copy the pid of extensionHost from the VSCode process explorer
    • In system terminal, run kill -s SIGUSR1 <pid-of-extension-host>
    • In system terminal, run lsof -Pan -p <pid-of-extension-host> -i.
    • Copy the host:port from the previous output
    • Open chrome or edge browser and visit chrome://inspect page
    • Click Open Dedicated developer tools for Node
    • In the Connection tab enter the host:port that was copied
    • The developer tools should now connect to this process and in the chrome://inspect/#devices page you should see an entry electron/js2c/utility_init under the Remote Devices section
  8. bmalehorn commented on Oct 10, 2023

    @bmalehorn
    ContributorAuthor

    Great, the output indicates the process has the inspector agent started on 127.0.0.1:57279. This confirms that utility process is able to start the inspector. Now as a next step, can you help us confirm if a client is able to connect to this agent,

    • Restart VSCode
    • Copy the pid of extensionHost from the VSCode process explorer
    • In system terminal, run kill -s SIGUSR1 <pid-of-extension-host>
    • In system terminal, run lsof -Pan -p <pid-of-extension-host> -i.
    ~ 
    ➜ kill -s SIGUSR1 56009                  
    
    ~ 
    ➜ lsof -Pan -p 56009 -i                   
    COMMAND     PID          USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
    Code\x20- 56009 brianmalehorn   43u  IPv4 0x50cd223cbea06e25      0t0  TCP 127.0.0.1:56567 (LISTEN)
    
    • Copy the host:port from the previous output
    • Open chrome or edge browser and visit chrome://inspect page
    • Click Open Dedicated developer tools for Node
    • In the Connection tab enter the host:port that was copied
    • The developer tools should now connect to this process and in the chrome://inspect/#devices page you should see an entry electron/js2c/utility_init under the Remote Devices section

    image
    image
    image

    Thanks for the instructions. Looks like everything connected OK. I can even use the devtools to capture a performance profile, which can be used as a workaround to find slow extensions.
    image

  9. deepak1556 commented on Oct 17, 2023

    @deepak1556
    Collaborator

    Thanks for confirming, Johannes Rieken (@jrieken) looks like the inspector agent is working fine for the user, so indicates an issue in the inspector client code path. For this action, the client we use is the profilingservice based on v8-inspect-profler

    this._extensionHostProfileService.startProfiling();
    , might be worth checking if there is a failure in this path.

  10. 3 remaining items

  11. added
    bug
    on Dec 4, 2023
  12. connor4312 commented on Dec 7, 2023

    @connor4312
    Member

    At least for me this seems to be because the profiler interface is trying to connect to ::1 where the devtools port is only listening on 127.0.0.1. Probably some extra information needs to be passed in this call: https://github.com/jrieken/v8-inspect-profiler/blob/master/index.js#L39

    The profile module also eats the underyling error which makes it a little harder to troubleshoot https://github.com/jrieken/v8-inspect-profiler/blob/master/index.js#L47-L52

  13. removed their assignment
    on Dec 8, 2023
  14. chouzz commented on Jun 3, 2024

    @chouzz

    Robo (@deepak1556) Connor Peet (@connor4312) Hi, just a question, the extension host profile command works well for me, but how should I analyze extension host performance in vscode.dev or code-server? Seems vscode.dev didn't have this command, and Chrome developer tools could record performance, but it records all the information, and not include extension host related information.

  15. connor4312 commented on Jun 3, 2024

    @connor4312
    Member

    Chrome devtools records performance, you need to look in the area for the web worker extension host.

  16. chouzz commented on Jun 3, 2024

    @chouzz

    Chrome devtools records performance, you need to look in the area for the web worker extension host.

    Got it! Thanks!

  17. locked and limited conversation to collaborators on Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugextension-hostunder-discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions