Uh oh!
There was an error while loading. Please reload this page.
trace_events: add traced_value.cc/traced_value.h - #21475
Conversation
jasnell
commented
Jun 22, 2018
jasnell
commented
Jun 29, 2018
ping @nodejs/diagnostics |
There was a problem hiding this comment.
not following how this is being used, and how its value is correct after a call sequence like BeginArray, BeginDictionary, EndDictionary.
There was a problem hiding this comment.
Look within the WriteComma function for use (https://github.com/nodejs/node/pull/21475/files#diff-7e8d44b3c53ea475e1b34c59578ed6e8R169) ...
The original implementation in V8 has DCHECK statements that are only enabled in debug builds that check for proper state. I pulled those to keep things simple but could add them back in as regular CHECKs
addaleax
left a comment
There was a problem hiding this comment.
Code-wise LGTM, but it’s hard to give feedback about the API itself without knowing how this is going to end up being used ;)
There was a problem hiding this comment.
nit: It would be nicer to return a std::string instead of making result an in/out parameter, tbh…
There was a problem hiding this comment.
I agree. I adopted this directly from the v8 impl. If it's ok to diverge then I can change
There was a problem hiding this comment.
Does return std::to_string(v); do the trick here too, for the default case?
There was a problem hiding this comment.
Ah, right, the challenge with std::to_string(v) is that it ignores any reasonable precision on the double and always prints six decimals, whereas the version used here will print with actual scientific notation (e.g. std::to_string(v) when v = 1.23e7, will print 12300000.000000 whereas the version used here will print 1.23e+07 as one would more reasonably expect.
There was a problem hiding this comment.
Same here, seems like it might be nicer to make out a return value rather than an in/out parameter
There was a problem hiding this comment.
This is part of the v8 trace event API and really isn't under our control, unfortunately.
mcollina
left a comment
There was a problem hiding this comment.
Can you please add a test that verifies that it escape strings correctly? JSON a few special chars, as well as UTF-8.
Port of the V8 internal v8::tracing::TracedValue that allows structured data to be included in the trace event. The v8 class is not exported in the public API so we cannot use it directly. This is a simplified and slightly modified port. This commit only adds the class, it does not add uses of it. Those will come in separate PRs/commits.
jasnell
commented
Jul 11, 2018
@mcollina ... Neither this nor the internal V8 version of |
jasnell
commented
Jul 11, 2018
jasnell
commented
Jul 11, 2018
jasnell
commented
Jul 11, 2018
@addaleax ... to give you a better idea about how this is going to be used... here's an example auto traced_value=TracedValue::Create();
traced_value->SetString("abc", "xyz");
TRACE_EVENT_NESTABLE_ASYNC_BEGIN1("cat", "name", 1, "data", traced_value);Within the trace event log, the |
Related failures in Windows and a couple others... trying again: https://ci.nodejs.org/job/node-test-pull-request/15819/ New run on Windows failed early for some reason... trying again on that platform: https://ci.nodejs.org/job/node-test-commit-windows-fanned/19232/ |
jasnell
commented
Jul 12, 2018
@nodejs/build ... Windows CI is failing with an odd one... |
Unfortunately, for windows-fanned jobs, "Resume Build" does not work. (I don't know if this is something Build WG can fix or not.) So for that, you need to use Rebuild on the windows-fanned job itself instead.
|
Trott
commented
Jul 12, 2018
Hmm...lots of stuff failing very fast. Something odd is up... |
Trott
commented
Jul 12, 2018
Ah, the problem might be test-softlayer-ubuntu1604-x64-1 which builds for a few different tasks. I'll see if someone is around on #node-build who might know how to investigate/fix. |
jasnell
commented
Jul 12, 2018
@Trott ... I was not using "Resume Build". When adding new commits, I always start a full CI run. |
jasnell
commented
Jul 12, 2018
jasnell
commented
Jul 12, 2018
woo... green CI. |
Port of the V8 internal v8::tracing::TracedValue that allows structured data to be included in the trace event. The v8 class is not exported in the public API so we cannot use it directly. This is a simplified and slightly modified port. This commit only adds the class, it does not add uses of it. Those will come in separate PRs/commits. PR-URL: #21475 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
jasnell
commented
Jul 12, 2018
Landed in d85449d |
Port of the V8 internal v8::tracing::TracedValue that allows structured data to be included in the trace event. The v8 class is not exported in the public API so we cannot use it directly. This is a simplified and slightly modified port. This commit only adds the class, it does not add uses of it. Those will come in separate PRs/commits. PR-URL: #21475 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Port of the V8 internal v8::tracing::TracedValue that allows
structured data to be included in the trace event. The v8 class
is not exported in the public API so we cannot use it directly.
This is a simplified and slightly modified port. This commit only
adds the class, it does not add uses of it. Those will come in
separate PRs/commits.
This will be used to include more complex data structures within
various trace events.
/cc @ofrobots@eugeneo @nodejs/diagnostics @nodejs/trace-events
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes