What we have: a bunch of global trace events.
Globals:
LTTNG_NET_SERVER_CONNECTION
...
&&
DTRACE_NET_SERVER_CONNECTION
...
What we need:
Globals:
NODE_NET_SERVER_CONNECTION
...
Where '...' represents the rest of the trace events.
What should happen:
With no instrumentation specified at build time, we should have the NODE_TRACE_EVENTS
resolve to noops.
When we compile in a tracer system, such as dtrace, or lttng, we should have a back-ended pool which the hooks can hook into.
So when we call NODE_NET_SERVER_CONNECTION
it should noop with no tracing enabled, or for example, with Dtrace enabled it should call DTRACE_NET_SERVER_CONNECTION
, and then be resolved to the DTRACE hook.
I think the structure for this is fairly simple to implement, we need to pull the generic, replicated code from the node_lttng.cc
and node_dtrace.cc
files, and make a generic node_tracing.cc
file, which the hooks can be compiled into, if enabled. However what we pull and noop will be complex, and I will need guidance with it! :)