Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to visualize profiling info from v8 profiler #196

Closed
slonka opened this issue Nov 6, 2018 · 5 comments
Closed

Ability to visualize profiling info from v8 profiler #196

slonka opened this issue Nov 6, 2018 · 5 comments
Labels

Comments

@slonka
Copy link
Contributor

slonka commented Nov 6, 2018

Hi,

V8 profiler has methods called StartProfiling, StopProfiling (https://v8docs.nodesource.com/node-10.6/d2/d34/classv8_1_1_cpu_profiler.html#ab78880137fc43d636cca23c81567b52d). There are modules that allow accessing these methods: https://github.com/hyj1991/v8-profiler-next/blob/master/src/cpu_profile.cc. I created a converter that can convert that format into something that is acceptable by 0x (generates a tree structure similar to the one generated here: https://github.com/davidmarkclements/0x/blob/master/lib/render.js#L19).

Would you be interested in including that functionality? (you can preview the code here: slonka@a9c848c and I'll create a PR if you want)

BTW I'm just wondering why did you only use --prof as a means of collecting stack information? How does it differ from CpuProfiler::StartProfiling?

@mcollina
Copy link
Collaborator

mcollina commented Nov 6, 2018

Would you be interested in including that functionality? (you can preview the code here: slonka/0x@a9c848c and I'll create a PR if you want)

I think so! Can you add a screenshot here of how that would look like?

BTW I'm just wondering why did you only use --prof as a means of collecting stack information? How does it differ from CpuProfiler::StartProfiling?

I think because we need no native addon to start that. @davidmarkclements definitely knows more!

@slonka
Copy link
Contributor Author

slonka commented Nov 6, 2018

I think so! Can you add a screenshot here of how that would look like?

Yeah sure. Here is a flamegraph of a simple server responding with a string hello under 10RPS.
screen shot 2018-11-06 at 10 39 37

To run it you simply invoke:
0x --visualize-v8-profile v8-profiler-output.json

I think because we need no native addon to start that. @davidmarkclements definitely knows more!

I was more interested in the profiling data that is provided. Does --prof call CpuProfiler::StartProfiling underneath?

@mcollina
Copy link
Collaborator

mcollina commented Nov 6, 2018

@slonka send the PR over. In your PR can you please add an example on how to generate that output?

I was more interested in the profiling data that is provided. Does --prof call CpuProfiler::StartProfiling underneath?

I never investigated in depth. The actual output looks very similar anyway.

@github-actions
Copy link

github-actions bot commented Jan 3, 2022

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Jan 3, 2022
@github-actions
Copy link

github-actions bot commented Jan 8, 2022

This issue was closed because it has been stalled for 5 days with no activity.

@github-actions github-actions bot closed this as completed Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants