Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Windows: don't fire GC ETW events without ETW consumers
  • Loading branch information
Igor Zinkovsky authored and piscisaureus committed Jun 14, 2012
1 parent 05fe70b commit 39d2337
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
8 changes: 0 additions & 8 deletions src/node.cc
Expand Up @@ -30,10 +30,6 @@
# include "node_dtrace.h"
#endif

#ifdef HAVE_ETW
# include "node_win32_etw_provider.h"
#endif

#include <locale.h>
#include <signal.h>
#include <stdio.h>
Expand Down Expand Up @@ -2901,10 +2897,6 @@ int Start(int argc, char *argv[]) {
// watchers, it blocks.
uv_run(uv_default_loop());

#ifdef HAVE_ETW
shutdown_etw();
#endif

EmitExit(process_l);
RunAtExit();

Expand Down
16 changes: 10 additions & 6 deletions src/node_win32_etw_provider-inl.h
Expand Up @@ -116,16 +116,20 @@ void NODE_NET_STREAM_END(node_dtrace_connection_t* conn) {


void NODE_GC_START(GCType type, GCCallbackFlags flags) {
EVENT_DATA_DESCRIPTOR descriptors[2];
ETW_WRITE_GC(descriptors, type, flags);
ETW_WRITE_EVENT(NODE_GC_START_EVENT, descriptors);
if (events_enabled > 0) {
EVENT_DATA_DESCRIPTOR descriptors[2];
ETW_WRITE_GC(descriptors, type, flags);
ETW_WRITE_EVENT(NODE_GC_START_EVENT, descriptors);
}
}


void NODE_GC_DONE(GCType type, GCCallbackFlags flags) {
EVENT_DATA_DESCRIPTOR descriptors[2];
ETW_WRITE_GC(descriptors, type, flags);
ETW_WRITE_EVENT(NODE_GC_DONE_EVENT, descriptors);
if (events_enabled > 0) {
EVENT_DATA_DESCRIPTOR descriptors[2];
ETW_WRITE_GC(descriptors, type, flags);
ETW_WRITE_EVENT(NODE_GC_DONE_EVENT, descriptors);
}
}


Expand Down

0 comments on commit 39d2337

Please sign in to comment.