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 19, 2024
1 parent e618b64 commit ff3258f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions patches/node/build_enable_perfetto.patch
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,37 @@ 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..6b2820c9dcce5e658b694f53e75d93707c4320d7 100644
--- a/lib/internal/http.js
+++ b/lib/internal/http.js
@@ -10,8 +10,8 @@ const {
const { setUnrefTimeout } = require('internal/timers');
const { trace, isTraceCategoryEnabled } = internalBinding('trace_events');
const {
- CHAR_LOWERCASE_B,
- CHAR_LOWERCASE_E,
+ CHAR_UPPERCASE_B,
+ CHAR_UPPERCASE_E,
} = require('internal/constants');

let utcCache;
@@ -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 ff3258f

Please sign in to comment.