GeezerVison is showing github.com — src: rename legacy trace event headers · nodejs/node@0611d44
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: Makefile +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1572,7 +1572,7 @@ LINT_CPP_EXCLUDE ?= | 1572 | 1572 | LINT_CPP_EXCLUDE += src/node_root_certs.h | 1573 | 1573 | LINT_CPP_EXCLUDE += $(LINT_CPP_ADDON_DOC_FILES) | 1574 | 1574 | # These files were copied more or less verbatim from V8. | 1575 | | -LINT_CPP_EXCLUDE += src/tracing/trace_event.h src/tracing/trace_event_common.h | | 1575 | +LINT_CPP_EXCLUDE += src/tracing/trace_event_legacy.h src/tracing/trace_event_legacy_inl.h | 1576 | 1576 |
| 1577 | 1577 | # deps/ncrypto is included in this list, as it is maintained in | 1578 | 1578 | # this repository, and should be linted. Eventually it should move | |
Collapse file Copy file name to clipboardExpand all lines: node.gyp +26-14Lines changed: 26 additions & 14 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 199 | 199 | 'src/timers.cc', | 200 | 200 | 'src/timer_wrap.cc', | 201 | 201 | 'src/tracing/agent.cc', | 202 | | - 'src/tracing/agent_legacy.cc', | 203 | | - 'src/tracing/node_trace_buffer.cc', | 204 | | - 'src/tracing/node_trace_writer.cc', | 205 | | - 'src/tracing/trace_event.cc', | | 202 | + 'src/tracing/trace_event_helper.cc', | 206 | 203 | 'src/tracing/traced_value.cc', | 207 | 204 | 'src/tty_wrap.cc', | 208 | 205 | 'src/udp_wrap.cc', | | 338 | 335 | 'src/tcp_wrap.h', | 339 | 336 | 'src/timers.h', | 340 | 337 | 'src/tracing/agent.h', | 341 | | - 'src/tracing/agent_legacy.h', | 342 | | - 'src/tracing/node_trace_buffer.h', | 343 | | - 'src/tracing/node_trace_writer.h', | | 338 | + 'src/tracing/trace_event_helper.h', | 344 | 339 | 'src/tracing/trace_event.h', | 345 | | - 'src/tracing/trace_event_common.h', | 346 | 340 | 'src/tracing/traced_value.h', | 347 | 341 | 'src/timer_wrap.h', | 348 | 342 | 'src/timer_wrap-inl.h', | | 449 | 443 | 'src/node_crypto.cc', | 450 | 444 | 'src/node_crypto.h', | 451 | 445 | ], | | 446 | + 'node_tracing_perfetto_sources': [ | | 447 | + ], | | 448 | + 'node_tracing_legacy_sources': [ | | 449 | + 'src/tracing/agent_legacy.cc', | | 450 | + 'src/tracing/agent_legacy.h', | | 451 | + 'src/tracing/node_trace_buffer.cc', | | 452 | + 'src/tracing/node_trace_buffer.h', | | 453 | + 'src/tracing/node_trace_writer.cc', | | 454 | + 'src/tracing/node_trace_writer.h', | | 455 | + 'src/tracing/trace_event_legacy_inl.h', | | 456 | + 'src/tracing/trace_event_legacy.h', | | 457 | + ], | 452 | 458 | 'node_cctest_openssl_sources': [ | 453 | 459 | 'test/cctest/test_crypto_clienthello.cc', | 454 | 460 | 'test/cctest/test_node_crypto.cc', | | 952 | 958 | }], | 953 | 959 | ], | 954 | 960 | }], | | 961 | + [ 'v8_use_perfetto==1', { | | 962 | + 'sources': [ | | 963 | + '<@(node_tracing_perfetto_sources)', | | 964 | + ], | | 965 | + 'dependencies': [ | | 966 | + 'deps/perfetto/perfetto.gyp:perfetto_sdk', | | 967 | + ], | | 968 | + }, { | | 969 | + 'sources': [ | | 970 | + '<@(node_tracing_legacy_sources)', | | 971 | + ], | | 972 | + }], | 955 | 973 | [ 'v8_enable_inspector==1', { | 956 | 974 | 'includes' : [ 'src/inspector/node_inspector.gypi' ], | 957 | 975 | }, { | | 1444 | 1462 | 'sources!': [ '<@(node_cctest_quic_sources)' ], | 1445 | 1463 | }], | 1446 | 1464 | [ 'v8_use_perfetto==1', { | 1447 | | - 'defines': [ | 1448 | | - 'PERFETTO_ENABLE_LEGACY_TRACE_EVENTS=1' | 1449 | | - ], | 1450 | 1465 | 'dependencies': [ | 1451 | 1466 | 'deps/perfetto/perfetto.gyp:perfetto_sdk', | 1452 | 1467 | ], | | 1773 | 1788 | ], | 1774 | 1789 | }], | 1775 | 1790 | [ 'v8_use_perfetto==1', { | 1776 | | - 'defines': [ | 1777 | | - 'PERFETTO_ENABLE_LEGACY_TRACE_EVENTS=1' | 1778 | | - ], | 1779 | 1791 | 'dependencies': [ | 1780 | 1792 | 'deps/perfetto/perfetto.gyp:perfetto_sdk', | 1781 | 1793 | ], | |
Collapse file Copy file name to clipboardExpand all lines: src/inspector_agent.cc +8Lines changed: 8 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 14 | 14 | #include "inspector/runtime_agent.h" | 15 | 15 | #include "inspector/storage_agent.h" | 16 | 16 | #include "inspector/target_agent.h" | | 17 | +#ifndef V8_USE_PERFETTO | 17 | 18 | #include "inspector/tracing_agent.h" | | 19 | +#endif // V8_USE_PERFETTO | 18 | 20 | #include "inspector/worker_agent.h" | 19 | 21 | #include "inspector/worker_inspector.h" | 20 | 22 | #include "inspector_io.h" | @@ -238,9 +240,11 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel, | 238 | 240 | StringView(), | 239 | 241 | V8Inspector::ClientTrustLevel::kFullyTrusted); | 240 | 242 | node_dispatcher_ = std::make_unique<UberDispatcher>(this); | | 243 | +#ifndef V8_USE_PERFETTO | 241 | 244 | tracing_agent_ = | 242 | 245 | std::make_unique<protocol::TracingAgent>(env, main_thread_); | 243 | 246 | tracing_agent_->Wire(node_dispatcher_.get()); | | 247 | +#endif // V8_USE_PERFETTO | 244 | 248 | if (worker_manager) { | 245 | 249 | worker_agent_ = std::make_unique<protocol::WorkerAgent>(worker_manager); | 246 | 250 | worker_agent_->Wire(node_dispatcher_.get()); | @@ -274,8 +278,10 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel, | 274 | 278 | } | 275 | 279 |
| 276 | 280 | ~ChannelImpl() override { | | 281 | +#ifndef V8_USE_PERFETTO | 277 | 282 | tracing_agent_->disable(); | 278 | 283 | tracing_agent_.reset(); // Dispose before the dispatchers | | 284 | +#endif // V8_USE_PERFETTO | 279 | 285 | if (worker_agent_) { | 280 | 286 | worker_agent_->disable(); | 281 | 287 | worker_agent_.reset(); // Dispose before the dispatchers | @@ -436,7 +442,9 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel, | 436 | 442 | } | 437 | 443 |
| 438 | 444 | std::unique_ptr<protocol::RuntimeAgent> runtime_agent_; | | 445 | +#ifndef V8_USE_PERFETTO | 439 | 446 | std::unique_ptr<protocol::TracingAgent> tracing_agent_; | | 447 | +#endif | 440 | 448 | std::unique_ptr<protocol::WorkerAgent> worker_agent_; | 441 | 449 | std::shared_ptr<protocol::TargetAgent> target_agent_; | 442 | 450 | std::unique_ptr<NetworkInspector> network_inspector_; | |
Collapse file Copy file name to clipboardExpand all lines: src/node_internals.h -9Lines changed: 0 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -317,15 +317,6 @@ class ThreadPoolWork { | 317 | 317 | const char* type_; | 318 | 318 | }; | 319 | 319 |
| 320 | | -#define TRACING_CATEGORY_NODE "node" | 321 | | -#define TRACING_CATEGORY_NODE1(one) \ | 322 | | - TRACING_CATEGORY_NODE "," \ | 323 | | - TRACING_CATEGORY_NODE "." #one | 324 | | -#define TRACING_CATEGORY_NODE2(one, two) \ | 325 | | - TRACING_CATEGORY_NODE "," \ | 326 | | - TRACING_CATEGORY_NODE "." #one "," \ | 327 | | - TRACING_CATEGORY_NODE "." #one "." #two | 328 | | - | 329 | 320 | // Functions defined in node.cc that are exposed via the bootstrapper object | 330 | 321 |
| 331 | 322 | #if defined(__POSIX__) && !defined(__ANDROID__) && !defined(__CloudABI__) | |
Collapse file Copy file name to clipboardExpand all lines: src/tracing/agent_legacy.h +4Lines changed: 4 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 6 | 6 | // This is an implementation of the legacy V8 tracing agent | 7 | 7 | // defined in `libplatform/v8-tracing.h`. | 8 | 8 |
| | 9 | +#ifdef V8_USE_PERFETTO | | 10 | +#error Perfetto is enabled. | | 11 | +#endif | | 12 | + | 9 | 13 | #include "libplatform/v8-tracing.h" | 10 | 14 | #include "node_mutex.h" | 11 | 15 | #include "tracing/agent.h" | |
|