Browse Source

lttng: update flags for gc tracing

PR-URL: https://github.com/nodejs/node/pull/3388
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
process-exit-stdio-flushing
Glen Keane 9 years ago
committed by Ben Noordhuis
parent
commit
9adc6a6bd0
  1. 60
      src/node_lttng_provider.h

60
src/node_lttng_provider.h

@ -7,6 +7,17 @@
namespace node { namespace node {
#define FOR_ALL_GC_TYPES(APPLY) \
APPLY(kGCTypeScavenge) \
APPLY(kGCTypeMarkSweepCompact) \
APPLY(kGCTypeAll)
#define FOR_ALL_GC_CALLBACK_FLAGS(APPLY) \
APPLY(kNoGCCallbackFlags) \
APPLY(kGCCallbackFlagConstructRetainedObjectInfos) \
APPLY(kGCCallbackFlagForced) \
APPLY(kGCCallbackFlagSynchronousPhantomCallbackProcessing)
void NODE_HTTP_SERVER_REQUEST(node_lttng_http_server_request_t* req, void NODE_HTTP_SERVER_REQUEST(node_lttng_http_server_request_t* req,
node_lttng_connection_t* conn, node_lttng_connection_t* conn,
const char *remote, int port, const char *remote, int port,
@ -48,42 +59,33 @@ void NODE_NET_STREAM_END(node_lttng_connection_t* conn,
void NODE_GC_START(v8::GCType type, void NODE_GC_START(v8::GCType type,
v8::GCCallbackFlags flags, v8::GCCallbackFlags flags,
v8::Isolate* isolate) { v8::Isolate* isolate) {
const char* typeStr = ""; const char* typeStr = "Unkown GC Type";
const char* flagsStr = ""; const char* flagsStr = "Unknown GC Flag";
if (type == v8::GCType::kGCTypeScavenge) {
typeStr = "kGCTypeScavenge"; #define BUILD_IF(f) if (type == v8::GCType::f) { typeStr = #f; }
} else if (type == v8::GCType::kGCTypeMarkSweepCompact) { FOR_ALL_GC_TYPES(BUILD_IF);
typeStr = "kGCTypeMarkSweepCompact"; #undef BUILD_IF
} else if (type == v8::GCType::kGCTypeAll) {
typeStr = "kGCTypeAll"; #define BUILD_IF(f) if (flags == v8::GCCallbackFlags::f) { flagsStr = #f; }
} FOR_ALL_GC_CALLBACK_FLAGS(BUILD_IF);
if (flags == v8::GCCallbackFlags::kNoGCCallbackFlags) { #undef BUILD_IF
flagsStr = "kNoGCCallbackFlags";
} else if (flags == v8::GCCallbackFlags::kGCCallbackFlagCompacted) {
flagsStr = "kGCCallbackFlagCompacted";
}
tracepoint(node, gc_start, typeStr, flagsStr); tracepoint(node, gc_start, typeStr, flagsStr);
} }
void NODE_GC_DONE(v8::GCType type, void NODE_GC_DONE(v8::GCType type,
v8::GCCallbackFlags flags, v8::GCCallbackFlags flags,
v8::Isolate* isolate) { v8::Isolate* isolate) {
const char* typeStr = ""; const char* typeStr = "Unkown GC Type";
const char* flagsStr = ""; const char* flagsStr = "Unknown GC Flag";
if (type == v8::GCType::kGCTypeScavenge) {
typeStr = "kGCTypeScavenge"; #define BUILD_IF(f) if (type == v8::GCType::f) { typeStr = #f; }
} else if (type == v8::GCType::kGCTypeMarkSweepCompact) { FOR_ALL_GC_TYPES(BUILD_IF);
typeStr = "kGCTypeMarkSweepCompact"; #undef BUILD_IF
} else if (type == v8::GCType::kGCTypeAll) {
typeStr = "kGCTypeAll"; #define BUILD_IF(f) if (flags == v8::GCCallbackFlags::f) { flagsStr = #f; }
} FOR_ALL_GC_CALLBACK_FLAGS(BUILD_IF);
if (flags == v8::GCCallbackFlags::kNoGCCallbackFlags) { #undef BUILD_IF
flagsStr = "kNoGCCallbackFlags";
} else if (flags == v8::GCCallbackFlags::kGCCallbackFlagCompacted) {
flagsStr = "kGCCallbackFlagCompacted";
}
tracepoint(node, gc_done, typeStr, flagsStr); tracepoint(node, gc_done, typeStr, flagsStr);
} }

Loading…
Cancel
Save