-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
cli: implement --cpu-prof[-path] #27147
Conversation
This patch introduces a CLI flag --cpu-prof that starts the V8 CPU profiler on start up, and ends the profiler then writes the CPU profile before the Node.js instance (on the main thread or the worker thread) exits. By default the profile is written to `${cwd}/CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile`. The patch also introduces a --cpu-prof-path flag for the user to specify the path the profile will be written to. Fixes: nodejs#26878
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I don't see where the filename is being formatted as described (like it is for the coverage reports)? |
This comment has been minimized.
This comment has been minimized.
// TODO(joyeecheung): fallback to exec path / argv[0] | ||
CHECK_EQ(err, 0); | ||
CHECK_GT(size, 0); | ||
DiagnosticFilename filename(env, "CPU", "cpuprofile"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
If there are no more questions I am going to land this on Friday. |
Landed in e0e3084 |
This patch introduces a CLI flag --cpu-prof that starts the V8 CPU profiler on start up, and ends the profiler then writes the CPU profile before the Node.js instance (on the main thread or the worker thread) exits. By default the profile is written to `${cwd}/CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile`. The patch also introduces a --cpu-prof-path flag for the user to specify the path the profile will be written to. Refs: #26878 PR-URL: #27147 Reviewed-By: Anna Henningsen <[email protected]>
we've added support for this in 0x https://github.com/davidmarkclements/0x#--visualize-cpu-profile |
This patch introduces a CLI flag --cpu-prof that starts the V8
CPU profiler on start up, and ends the profiler then writes the
CPU profile before the Node.js instance (on the main thread or
the worker thread) exits. By default the profile is written to
${cwd}/CPU.${yyyymmdd}.${hhmmss}.${pid}.${tid}.${seq}.cpuprofile
.The patch also introduces a --cpu-prof-path flag for the user
to specify the path the profile will be written to.
Fixes: #26878
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes