src: add --title command line argument, trace event #21477
Conversation
|
some relevant failures in CI. |
|
@ofrobots ... when you get a moment, can you take a look at this? It would appear that |
doc/node.1
Outdated
| @@ -164,6 +164,9 @@ instead of printing to stderr. | |||
| .It Fl -throw-deprecation | |||
| Throw errors for deprecations. | |||
| . | |||
| .It Fl -title Ns = Ns Ar title | |||
| Specify the process.title on startup | |||
Nit: missing period.
Nit: remove the
doc/api/cli.md
Outdated
| added: REPLACEME | ||
| --> | ||
|
|
||
| Set the `process.title` on startup. |
Nit: remove the
|
Still exploring why the trace event bit is failing on some of the CI machines.. unable to recreate locally... https://ci.nodejs.org/job/node-test-pull-request/15587/ |
src/node.cc
Outdated
| @@ -2813,6 +2817,8 @@ static void ParseArgs(int* argc, | |||
| } else if (strncmp(arg, "--security-revert=", 18) == 0) { | |||
| const char* cve = arg + 18; | |||
| Revert(cve); | |||
| } else if (strncmp(arg, "--title=", 8) == 0) { | |||
| uv_set_process_title(arg + 8); | |||
Are you sure this is safe? Setting the process title (which on a lot of OS works by overwriting argv) while iterating over argv?
Possibly not ;) still verifying and chasing down a few issues that are likely being caused by exactly this problem. I have a change staged locally that moves the actual set_process_title call to after the args are processed but haven't pushed it up to test yet
Is the addition of --title tied to the trace event things, or is it a convenience thing? It seems like it’s pretty easy already to set the process title from inside the JS code, so it might be okay to leave this out…?
They are not tied together but the use case is closely related for me. The introduction of --title is specifically for cases of profiling other users code that I don't exactly want to have to modify just to set the title... using a preload module is a bit overkill for that.
|
Another CI: https://ci.nodejs.org/job/node-test-pull-request/15613/ This is failing on SmartOS only at this point. |
Simple utility command line argument for setting the process title on process startup.
|
Ok, should be good to go now: https://ci.nodejs.org/job/node-test-pull-request/15615/ |
|
CI is good. One unrelated flaky failure in windows. |
Then it's not quite good yet. :-D |
|
Let's give it one more shot since the unrelated windows failure happened again https://ci.nodejs.org/job/node-test-pull-request/15676/ |
PR-URL: #21477 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Simple utility command line argument for setting the process title on process startup. PR-URL: #21477 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
PR-URL: #21477 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Simple utility command line argument for setting the process title on process startup. PR-URL: #21477 Reviewed-By: Bradley Farias <bradley.meck@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Notable changes: * console: * The `console.timeLog()` method has been implemented. (#21312) * deps: * Upgrade to libuv 1.22.0. (#21731) * Upgrade to ICU 62.1 (Unicode 11, CLDR 33.1). (#21728) * http: * Added support for passing both `timeout` and `agent` options to `http.request`. (#21204) * napi: * Added experimental support for functions dealing with bigint numbers. (#21226) * process: * The `process.hrtime.bigint()` method has been implemented. (#21256) * Added the `--title` command line argument to set the process title on startup. (#21477) * trace_events: * Added process_name metadata. (#21477)
Notable changes: * console: * The `console.timeLog()` method has been implemented. (#21312) * deps: * Upgrade to libuv 1.22.0. (#21731) * Upgrade to ICU 62.1 (Unicode 11, CLDR 33.1). (#21728) * http: * Added support for passing both `timeout` and `agent` options to `http.request`. (#21204) * napi: * Added experimental support for functions dealing with bigint numbers. (#21226) * process: * The `process.hrtime.bigint()` method has been implemented. (#21256) * Added the `--title` command line argument to set the process title on startup. (#21477) * trace_events: * Added process_name metadata. (#21477) * Added new collaborators * codebytere - Shelley Vohr PR-URL: #21851
Notable changes:
* console:
* The `console.timeLog()` method has been implemented.
(#21312)
* deps:
* Upgrade to libuv 1.22.0. (#21731)
* Upgrade to ICU 62.1 (Unicode 11, CLDR 33.1).
(#21728)
* http:
* Added support for passing both `timeout` and `agent` options to
`http.request`. (#21204)
* inspector:
* Expose the original console API in `require('inspector').console`.
(#21659)
* napi:
* Added experimental support for functions dealing with bigint numbers.
(#21226)
* process:
* The `process.hrtime.bigint()` method has been implemented.
(#21256)
* Added the `--title` command line argument to set the process title on
startup. (#21477)
* trace_events:
* Added process_name metadata.
(#21477)
* Added new collaborators
* codebytere - Shelley Vohr
PR-URL: #21851
Notable changes:
* console:
* The `console.timeLog()` method has been implemented.
(#21312)
* deps:
* Upgrade to libuv 1.22.0. (#21731)
* Upgrade to ICU 62.1 (Unicode 11, CLDR 33.1).
(#21728)
* http:
* Added support for passing both `timeout` and `agent` options to
`http.request`. (#21204)
* inspector:
* Expose the original console API in `require('inspector').console`.
(#21659)
* napi:
* Added experimental support for functions dealing with bigint numbers.
(#21226)
* process:
* The `process.hrtime.bigint()` method has been implemented.
(#21256)
* Added the `--title` command line argument to set the process title on
startup. (#21477)
* trace_events:
* Added process_name metadata.
(#21477)
* Added new collaborators
* codebytere - Shelley Vohr
PR-URL: #21851
Adds a simple utility
--titlecommand line argument to set the process title on startup. Also, emit theprocess_namemetadata to the trace event log.When emit trace events, the process name appears within the trace event viewer UI:
Changes to
process.titlealso appear within the trace_event log:/cc @ofrobots @eugeneo
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesThe text was updated successfully, but these errors were encountered: