Skip to content

Commit

Permalink
fix: update lib/internal/http for perfetto
Browse files Browse the repository at this point in the history
  • Loading branch information
codebytere committed Apr 18, 2024
1 parent e618b64 commit 53fd714
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions patches/node/build_enable_perfetto.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,26 @@ adding associated guards there should be relatively small.

We should upstream this as it will eventually impact Node.js as well.

diff --git a/lib/internal/http.js b/lib/internal/http.js
index b20b3cd229efcd9701791309361b7d106f315900..a00e6e00e39dbc6da613cee49da1b017bb9090d9 100644
--- a/lib/internal/http.js
+++ b/lib/internal/http.js
@@ -44,11 +44,13 @@ function isTraceHTTPEnabled() {
const traceEventCategory = 'node,node.http';

function traceBegin(...args) {
- trace(CHAR_LOWERCASE_B, traceEventCategory, ...args);
+ // See v8/src/builtins/builtins-trace.cc - must be uppercase for perfetto
+ trace(CHAR_UPPERCASE_B, traceEventCategory, ...args);
}

function traceEnd(...args) {
- trace(CHAR_LOWERCASE_E, traceEventCategory, ...args);
+ // See v8/src/builtins/builtins-trace.cc - must be uppercase for perfetto
+ trace(CHAR_UPPERCASE_E, traceEventCategory, ...args);
}

module.exports = {
diff --git a/src/tracing/agent.cc b/src/tracing/agent.cc
index 7ce59674356f9743438350949be42fa7ead2afbe..c5fedc3be86a77730c57321b9c73cc8e94a001d7 100644
--- a/src/tracing/agent.cc
Expand Down

0 comments on commit 53fd714

Please sign in to comment.