inspector: split --cpu-prof-path to --cpu-prof-dir and --cpu-prof-name by joyeecheung · Pull Request #27306 · nodejs/node (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation22 Commits4 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
To improve the integration of --cpu-prof
with workers, this patch
splits --cpu-prof-path
into --cpu-prof-dir
and --cpu-prof-name
,
so when a worker is launched from a thread that enables--cpu-prof
, if the parent thread sets --cpu-prof-dir
, then the
profile of both thread would be generated to the specified directory.
If they end up specifying the same --cpu-prof-name
the behavior
is undefined - the last profile will overwritten the first one.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes- commit message follows commit guidelines
This comment has been minimized.
nodejs-github-bot added c++
Issues and PRs that require attention from people who are familiar with C++.
Issues and PRs related to general changes in the lib or src directory.
labels
This comment has been minimized.
cc @nodejs/workers @nodejs/performance @nodejs/process
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Why --prof-dir
instead of something more specific like --cpu-prof-dir
? Having non-V8 --prof-*
options is confusing because we already have --prof
and --prof-process
for V8.
To improve the integration of --cpu-prof
with workers, this patch
splits --cpu-prof-path
into --prof-dir
and --cpu-prof-name
,
so when a worker is launched from a thread that enables
--cpu-prof
, if the parent thread sets --prof-dir
, then the
profile of both thread would be generated to the specified directory.
If they end up specifying the same --cpu-prof-name
the behavior
is undefined the last profile will overwritten the first one.
I prefer keeping the specific directory prefix in the flag names for clarity. If we support more profile types in the future it just gives more flexibility.
I prefer keeping the specific directory prefix in the flag names for clarity. If we support more profile types in the future it just gives more flexibility.
How would that gives more flexibility? If the whole path is specified in the flag, how would --cpu-prof-path
work with workers? With --cpu-prof-path
, you either hard-code the entire path, or nothing at all. With --prof-dir
and --cpu-prof-name
you can just hard-code the directory but let Node.js generate the file name for you, which I believe is the more common use case.
BTW, this is also closer to how the reports are generated. I think it's better to have a consistent style to generate these files.
This comment has been minimized.
Moved the directory initialization to env.cc and renamed --prof-dir
to --node-prof-dir
to avoid the ambiguity. @mcollina @addaleax @mscdex PTAL, thanks!
With
--cpu-prof-path
, you either hard-code the entire path, or nothing at all.
I was referring to having individual profile type directory prefix flags like --cpu-prof-dir
vs a --prof-dir
for all profile types.
I was referring to having individual profile type directory prefix flags like --cpu-prof-dir vs a --prof-dir for all profile types.
I see, that makes sense to me, I'll switch to that instead, thanks!
This comment has been minimized.
joyeecheung changed the title
inspector: split --cpu-prof-path to --prof-dir and --cpu-prof-name inspector: split --cpu-prof-path to --cpu-prof-dir and --cpu-prof-name
This comment has been minimized.
If there are no more reviews, I'd like to land this later today.
joyeecheung added the author ready
PRs that have at least one approval, no pending requests for changes, and a CI started.
label
joyeecheung added a commit that referenced this pull request
To improve the integration of --cpu-prof
with workers, this patch
splits --cpu-prof-path
into --cpu-prof-dir
and --cpu-prof-name
,
so when a worker is launched from a thread that enables
--cpu-prof
, if the parent thread sets --cpu-prof-dir
, then the
profile of both thread would be generated to the specified directory.
If they end up specifying the same --cpu-prof-name
the behavior
is undefined the last profile will overwritten the first one.
PR-URL: #27306 Reviewed-By: Anna Henningsen anna@addaleax.net Reviewed-By: Matteo Collina matteo.collina@gmail.com
This was referenced
Apr 23, 2019
Labels
PRs that have at least one approval, no pending requests for changes, and a CI started.
Issues and PRs that require attention from people who are familiar with C++.
Issues and PRs related to general changes in the lib or src directory.