trace_events: add file pattern cli option#18480
trace_events: add file pattern cli option#18480AndreasMadsen wants to merge 2 commits intonodejs:masterfrom AndreasMadsen:trace-event-filepath
Conversation
doc/api/tracing.md
Outdated
There was a problem hiding this comment.
nit: an printf -> a printf
There was a problem hiding this comment.
Please avoid using you in the docs :-)
src/node.cc
Outdated
There was a problem hiding this comment.
Please could you also update the list of whitelisted options in the NODE_OPTIONS section of the CLI documentation?
src/tracing/node_trace_writer.cc
Outdated
There was a problem hiding this comment.
Since there's no validation of log_file_pattern things can go bad here.
e.g.,
-bash-4.2$ ./node --trace-events-enabled --trace-event-file-pattern 'tracelog.%s.log' -e 'setTimeout(() => { for (var i = 0; i < 100000; i++) { "test" + i } }, 1)'
Warning: Trace event is an experimental feature and could change at any time.
Segmentation fault (core dumped)
-bash-4.2$There was a problem hiding this comment.
I know. But it is a CLI flag, we document what the user should use, and it is an advanced feature. Adding validation would add a lot of complexity here.
|
I am not opposed to this approach, but have you considered something simpler like:
This gets rid of the need to do parsing and formatting, and is an easier option for users to remember and correctly specify? |
|
@ofrobots That only works if the For https://github.com/nearform/node-clinic-doctor we collect data from multiple sources and store each of them in a file. To not make it too noisy we put all of them in a directory called Right now this is done by an |
|
@AndreasMadsen I share the concerns from @richardlau here. Advanced feature or not, propensity for segfaulting isn't very nice. Could we deem that the prefix could include a directory + filename components, and go with the simpler approach as I proposed? Something like: |
|
@ofrobots That doesn't really satisfy my usecase for having the |
|
I suppose we could allow a syntax like |
|
All comments should be addressed now. PTAL |
src/node.cc
Outdated
There was a problem hiding this comment.
nit: this bit needs to be updated with the new template strings.
|
|
|
I called it |
|
Apparently, we just changed the way tempdirs are created, thus the test failed after the CI rebased. |
|
There appear to be some failures. Unfortunately, I don't have easy access to any of those OS's. It could also be a compile-chain issue. Any ideas? |
|
There were infra issues on at least some of the machines, here's a relaunch: https://ci.nodejs.org/job/node-test-pull-request/13072/ |
jasnell
left a comment
There was a problem hiding this comment.
LGTM once CI is figured out. There's nothing obvious that stands out as being problematic.
|
Landed in 85212bb |
Allow the user to specify the filepath for the trace_events log file using a template string. PR-URL: #18480 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Allow the user to specify the filepath for the trace_events log file using a template string. Backport-PR-URL: #19144 PR-URL: #18480 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Notable Changes:
* crypto:
- add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson)
#17690
* lib:
- v8_prof_processor works again 🎉 (Anna Henningsen)
#19059
* loader:
- --inspect-brk now works properly for esmodules (Gus Caplan)
#18949
* src:
- handle exceptions in env-\>SetImmediates (James M Snell)
#18297
- make process.dlopen() load well-known symbol (Ben Noordhuis)
#18934
* trace_events:
- add file pattern cli option (Andreas Madsen)
#18480
PR-URL: #19181
Notable Changes:
* crypto:
- add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson)
#17690
* lib:
- v8_prof_processor works again 🎉 (Anna Henningsen)
#19059
* loader:
- --inspect-brk now works properly for esmodules (Gus Caplan)
#18949
* src:
- handle exceptions in env-\>SetImmediates (James M Snell)
#18297
- make process.dlopen() load well-known symbol (Ben Noordhuis)
#18934
* trace_events:
- add file pattern cli option (Andreas Madsen)
#18480
PR-URL: #19181
Notable Changes:
* crypto:
- add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson)
#17690
* http2:
- Fixed issues with aborted connections in the HTTP/2 implementation
(Anna Henningsen)
#18987
#19002
* loader:
- --inspect-brk now works properly for esmodules (Gus Caplan)
#18949
* src:
- make process.dlopen() load well-known symbol (Ben Noordhuis)
#18934
* trace_events:
- add file pattern cli option (Andreas Madsen)
#18480
* Added new collaborators:
- Chen Gang (MoonBall) https://github.com/MoonBall
PR-URL: #19181
Notable Changes:
* crypto:
- add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson)
#17690
* http2:
- Fixed issues with aborted connections in the HTTP/2 implementation
(Anna Henningsen)
#18987
#19002
* loader:
- --inspect-brk now works properly for esmodules (Gus Caplan)
#18949
* src:
- make process.dlopen() load well-known symbol (Ben Noordhuis)
#18934
* trace_events:
- add file pattern cli option (Andreas Madsen)
#18480
* Added new collaborators:
- Chen Gang (MoonBall) https://github.com/MoonBall
PR-URL: #19181
Allow the user to specify the filepath for the trace_events log file using a template string. PR-URL: nodejs#18480 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Notable Changes:
* crypto:
- add cert.fingerprint256 as SHA256 fingerprint (Hannes Magnusson)
nodejs#17690
* http2:
- Fixed issues with aborted connections in the HTTP/2 implementation
(Anna Henningsen)
nodejs#18987
nodejs#19002
* loader:
- --inspect-brk now works properly for esmodules (Gus Caplan)
nodejs#18949
* src:
- make process.dlopen() load well-known symbol (Ben Noordhuis)
nodejs#18934
* trace_events:
- add file pattern cli option (Andreas Madsen)
nodejs#18480
* Added new collaborators:
- Chen Gang (MoonBall) https://github.com/MoonBall
PR-URL: nodejs#19181
Allow the user to specify the filepath for the trace_events log file using a template string. Backport-PR-URL: #19145 PR-URL: #18480 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Allow the user to specify the filepath for the trace_events log file using a template string. Backport-PR-URL: #19145 PR-URL: #18480 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Allow the user to specify the filepath for the trace_events log file using a template string. Backport-PR-URL: #19145 PR-URL: #18480 Reviewed-By: Ali Ijaz Sheikh <[email protected]> Reviewed-By: Richard Lau <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
Notable Changes:
* async_hooks:
- rename PromiseWrap.parentId (Ali Ijaz Sheikh)
#18633
- remove runtime deprecation (Ali Ijaz Sheikh)
#19517
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
#18513
* cluster:
- add cwd to cluster.settings (cjihrig)
#18399
- support windowsHide option for workers (Todd Wong)
#17412
* crypto:
- allow passing null as IV unless required (Tobias Nießen)
#18644
* deps:
- upgrade npm to 6.2.0 (Kat Marchán)
#21592
- upgrade libuv to 1.19.2 (cjihrig)
#18918
- Upgrade node-inspect to 1.11.5 (Jan Krems)
#21055
* fs,net:
- support as and as+ flags in stringToFlags() (Sarat Addepalli)
#18801
- emit 'ready' for fs streams and sockets (Sameer Srivastava)
#19408
* http, http2:
- add options to http.createServer() (Peter Marton)
#15752
- add 103 Early Hints status code (Yosuke Furukawa)
#16644
- add http fallback options to .createServer (Peter Marton)
#15752
* n-api:
- take n-api out of experimental (Michael Dawson)
#19262
* perf_hooks:
- add warning when too many entries in the timeline (James M Snell)
#18087
* src:
- add public API for managing NodePlatform (Cheng Zhao)
#16981
- allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
#17600
- node internals' postmortem metadata (Matheus Marchini)
#14901
* tls:
- expose Finished messages in TLSSocket (Anton Salikhmetov)
#19102
* **trace_events**:
- add file pattern cli option (Andreas Madsen)
#18480
* util:
- implement util.getSystemErrorName() (Joyee Cheung)
#18186
PR-URL: #21593
Notable Changes:
* async_hooks:
- rename PromiseWrap.parentId (Ali Ijaz Sheikh)
nodejs#18633
- remove runtime deprecation (Ali Ijaz Sheikh)
nodejs#19517
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
nodejs#18513
* cluster:
- add cwd to cluster.settings (cjihrig)
nodejs#18399
- support windowsHide option for workers (Todd Wong)
nodejs#17412
* crypto:
- allow passing null as IV unless required (Tobias Nießen)
nodejs#18644
* deps:
- upgrade npm to 6.2.0 (Kat Marchán)
nodejs#21592
- upgrade libuv to 1.19.2 (cjihrig)
nodejs#18918
- Upgrade node-inspect to 1.11.5 (Jan Krems)
nodejs#21055
* fs,net:
- support as and as+ flags in stringToFlags() (Sarat Addepalli)
nodejs#18801
- emit 'ready' for fs streams and sockets (Sameer Srivastava)
nodejs#19408
* http, http2:
- add options to http.createServer() (Peter Marton)
nodejs#15752
- add 103 Early Hints status code (Yosuke Furukawa)
nodejs#16644
- add http fallback options to .createServer (Peter Marton)
nodejs#15752
* n-api:
- take n-api out of experimental (Michael Dawson)
nodejs#19262
* perf_hooks:
- add warning when too many entries in the timeline (James M Snell)
nodejs#18087
* src:
- add public API for managing NodePlatform (Cheng Zhao)
nodejs#16981
- allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
nodejs#17600
- node internals' postmortem metadata (Matheus Marchini)
nodejs#14901
* tls:
- expose Finished messages in TLSSocket (Anton Salikhmetov)
nodejs#19102
* **trace_events**:
- add file pattern cli option (Andreas Madsen)
nodejs#18480
* util:
- implement util.getSystemErrorName() (Joyee Cheung)
nodejs#18186
PR-URL: nodejs#21593
Notable Changes:
* async_hooks:
- rename PromiseWrap.parentId (Ali Ijaz Sheikh)
#18633
- remove runtime deprecation (Ali Ijaz Sheikh)
#19517
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
#18513
* cluster:
- add cwd to cluster.settings (cjihrig)
#18399
- support windowsHide option for workers (Todd Wong)
#17412
* crypto:
- allow passing null as IV unless required (Tobias Nießen)
#18644
* deps:
- upgrade npm to 6.4.1 (Kat Marchán)
#22591
- upgrade libuv to 1.19.2 (cjihrig)
#18918
- Upgrade node-inspect to 1.11.5 (Jan Krems)
#21055
* fs,net:
- support as and as+ flags in stringToFlags() (Sarat Addepalli)
#18801
- emit 'ready' for fs streams and sockets (Sameer Srivastava)
#19408
* http, http2:
- add options to http.createServer() (Peter Marton)
#15752
- add 103 Early Hints status code (Yosuke Furukawa)
#16644
- add http fallback options to .createServer (Peter Marton)
#15752
* n-api:
- take n-api out of experimental (Michael Dawson)
#19262
* perf_hooks:
- add warning when too many entries in the timeline (James M Snell)
#18087
* src:
- add public API for managing NodePlatform (Cheng Zhao)
#16981
- allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
#17600
- node internals' postmortem metadata (Matheus Marchini)
#14901
* tls:
- expose Finished messages in TLSSocket (Anton Salikhmetov)
#19102
* **trace_events**:
- add file pattern cli option (Andreas Madsen)
#18480
* util:
- implement util.getSystemErrorName() (Joyee Cheung)
#18186
PR-URL: #21593
Notable Changes:
* async_hooks:
- rename PromiseWrap.parentId (Ali Ijaz Sheikh)
#18633
- remove runtime deprecation (Ali Ijaz Sheikh)
#19517
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
#18513
* cluster:
- add cwd to cluster.settings (cjihrig)
#18399
- support windowsHide option for workers (Todd Wong)
#17412
* crypto:
- allow passing null as IV unless required (Tobias Nießen)
#18644
* deps:
- upgrade npm to 6.2.0 (Kat Marchán)
#21592
- upgrade libuv to 1.19.2 (cjihrig)
#18918
- Upgrade node-inspect to 1.11.5 (Jan Krems)
#21055
* fs,net:
- support as and as+ flags in stringToFlags() (Sarat Addepalli)
#18801
- emit 'ready' for fs streams and sockets (Sameer Srivastava)
#19408
* http, http2:
- add options to http.createServer() (Peter Marton)
#15752
- add 103 Early Hints status code (Yosuke Furukawa)
#16644
- add http fallback options to .createServer (Peter Marton)
#15752
* n-api:
- take n-api out of experimental (Michael Dawson)
#19262
* perf_hooks:
- add warning when too many entries in the timeline (James M Snell)
#18087
* src:
- add public API for managing NodePlatform (Cheng Zhao)
#16981
- allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
#17600
- node internals' postmortem metadata (Matheus Marchini)
#14901
* tls:
- expose Finished messages in TLSSocket (Anton Salikhmetov)
#19102
* **trace_events**:
- add file pattern cli option (Andreas Madsen)
#18480
* util:
- implement util.getSystemErrorName() (Joyee Cheung)
#18186
PR-URL: #21593
Notable Changes:
* async_hooks:
- rename PromiseWrap.parentId (Ali Ijaz Sheikh)
#18633
- remove runtime deprecation (Ali Ijaz Sheikh)
#19517
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
#18513
* cluster:
- add cwd to cluster.settings (cjihrig)
#18399
- support windowsHide option for workers (Todd Wong)
#17412
* crypto:
- allow passing null as IV unless required (Tobias Nießen)
#18644
* deps:
- upgrade npm to 6.2.0 (Kat Marchán)
#21592
- upgrade libuv to 1.19.2 (cjihrig)
#18918
- Upgrade node-inspect to 1.11.5 (Jan Krems)
#21055
* fs,net:
- support as and as+ flags in stringToFlags() (Sarat Addepalli)
#18801
- emit 'ready' for fs streams and sockets (Sameer Srivastava)
#19408
* http, http2:
- add options to http.createServer() (Peter Marton)
#15752
- add 103 Early Hints status code (Yosuke Furukawa)
#16644
- add http fallback options to .createServer (Peter Marton)
#15752
* n-api:
- take n-api out of experimental (Michael Dawson)
#19262
* perf_hooks:
- add warning when too many entries in the timeline (James M Snell)
#18087
* src:
- add public API for managing NodePlatform (Cheng Zhao)
#16981
- allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
#17600
- node internals' postmortem metadata (Matheus Marchini)
#14901
* tls:
- expose Finished messages in TLSSocket (Anton Salikhmetov)
#19102
* **trace_events**:
- add file pattern cli option (Andreas Madsen)
#18480
* util:
- implement util.getSystemErrorName() (Joyee Cheung)
#18186
PR-URL: #21593
Notable Changes:
* async_hooks:
- rename PromiseWrap.parentId (Ali Ijaz Sheikh)
#18633
- remove runtime deprecation (Ali Ijaz Sheikh)
#19517
- deprecate unsafe emit{Before,After} (Ali Ijaz Sheikh)
#18513
* cluster:
- add cwd to cluster.settings (cjihrig)
#18399
- support windowsHide option for workers (Todd Wong)
#17412
* crypto:
- allow passing null as IV unless required (Tobias Nießen)
#18644
* deps:
- upgrade npm to 6.2.0 (Kat Marchán)
#21592
- upgrade libuv to 1.19.2 (cjihrig)
#18918
- Upgrade node-inspect to 1.11.5 (Jan Krems)
#21055
* fs,net:
- support as and as+ flags in stringToFlags() (Sarat Addepalli)
#18801
- emit 'ready' for fs streams and sockets (Sameer Srivastava)
#19408
* http, http2:
- add options to http.createServer() (Peter Marton)
#15752
- add 103 Early Hints status code (Yosuke Furukawa)
#16644
- add http fallback options to .createServer (Peter Marton)
#15752
* n-api:
- take n-api out of experimental (Michael Dawson)
#19262
* perf_hooks:
- add warning when too many entries in the timeline (James M Snell)
#18087
* src:
- add public API for managing NodePlatform (Cheng Zhao)
#16981
- allow --perf-(basic-)?prof in NODE\_OPTIONS (Leko)
#17600
- node internals' postmortem metadata (Matheus Marchini)
#14901
* tls:
- expose Finished messages in TLSSocket (Anton Salikhmetov)
#19102
* **trace_events**:
- add file pattern cli option (Andreas Madsen)
#18480
* util:
- implement util.getSystemErrorName() (Joyee Cheung)
#18186
PR-URL: #21593
Allow the user to specify the filepath for the trace_events log file using a printf format string.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
trace_events/cc @ofrobots