Browse Source

src: fixes for win32

Update following macros:

* NODE_NET_SOCKET_{READ,WRITE}() - they both take 4 arguments,
  not 2

* NODE_COUNT_GC_PERCENTTIME() - it takes a single argument.

Use INT_PTR instead of INT32 in pointer casts in win32_etw provider.

PR-URL: https://github.com/joyent/node/pull/8294
Reviewed-By: Fedor Indutny <fedor@indutny.com>
archived-io.js-v0.12
Ray Donnelly 10 years ago
committed by Fedor Indutny
parent
commit
6f94b3db91
  1. 2
      src/node_counters.h
  2. 10
      src/node_win32_etw_provider-inl.h
  3. 4
      src/node_win32_etw_provider.h

2
src/node_counters.h

@ -37,7 +37,7 @@
#define NODE_COUNT_NET_BYTES_SENT(bytes) #define NODE_COUNT_NET_BYTES_SENT(bytes)
#define NODE_COUNT_NET_BYTES_RECV(bytes) #define NODE_COUNT_NET_BYTES_RECV(bytes)
#define NODE_COUNT_GET_GC_RAWTIME() #define NODE_COUNT_GET_GC_RAWTIME()
#define NODE_COUNT_GC_PERCENTTIME() #define NODE_COUNT_GC_PERCENTTIME(percent)
#define NODE_COUNT_PIPE_BYTES_SENT(bytes) #define NODE_COUNT_PIPE_BYTES_SENT(bytes)
#define NODE_COUNT_PIPE_BYTES_RECV(bytes) #define NODE_COUNT_PIPE_BYTES_RECV(bytes)
#endif #endif

10
src/node_win32_etw_provider-inl.h

@ -25,6 +25,12 @@
#include "node_win32_etw_provider.h" #include "node_win32_etw_provider.h"
#include "node_etw_provider.h" #include "node_etw_provider.h"
#if defined(_WIN64)
# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT64_DATA
#else
# define ETW_WRITE_INTPTR_DATA ETW_WRITE_INT32_DATA
#endif
namespace node { namespace node {
// From node_win32_etw_provider.cc // From node_win32_etw_provider.cc
@ -92,7 +98,7 @@ extern int events_enabled;
ETW_WRITE_ADDRESS_DATA(descriptors, &context); \ ETW_WRITE_ADDRESS_DATA(descriptors, &context); \
ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \ ETW_WRITE_ADDRESS_DATA(descriptors + 1, &startAddr); \
ETW_WRITE_INT64_DATA(descriptors + 2, &size); \ ETW_WRITE_INT64_DATA(descriptors + 2, &size); \
ETW_WRITE_INT32_DATA(descriptors + 3, &id); \ ETW_WRITE_INTPTR_DATA(descriptors + 3, &id); \
ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \ ETW_WRITE_INT16_DATA(descriptors + 4, &flags); \
ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \ ETW_WRITE_INT16_DATA(descriptors + 5, &rangeId); \
ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \ ETW_WRITE_INT64_DATA(descriptors + 6, &sourceId); \
@ -241,7 +247,7 @@ void NODE_V8SYMBOL_ADD(LPCSTR symbol,
} }
void* context = NULL; void* context = NULL;
INT64 size = (INT64)len; INT64 size = (INT64)len;
INT32 id = (INT32)addr1; INT_PTR id = (INT_PTR)addr1;
INT16 flags = 0; INT16 flags = 0;
INT16 rangeid = 1; INT16 rangeid = 1;
INT32 col = 1; INT32 col = 1;

4
src/node_win32_etw_provider.h

@ -92,8 +92,8 @@ INLINE bool NODE_NET_SOCKET_READ_ENABLED();
INLINE bool NODE_NET_SOCKET_WRITE_ENABLED(); INLINE bool NODE_NET_SOCKET_WRITE_ENABLED();
INLINE bool NODE_V8SYMBOL_ENABLED(); INLINE bool NODE_V8SYMBOL_ENABLED();
#define NODE_NET_SOCKET_READ(arg0, arg1) #define NODE_NET_SOCKET_READ(arg0, arg1, arg2, arg3)
#define NODE_NET_SOCKET_WRITE(arg0, arg1) #define NODE_NET_SOCKET_WRITE(arg0, arg1, arg2, arg3)
} // namespace node } // namespace node
#endif // SRC_NODE_WIN32_ETW_PROVIDER_H_ #endif // SRC_NODE_WIN32_ETW_PROVIDER_H_

Loading…
Cancel
Save