Add general trace-event logging instrumentation to Tor
Relevant to #13792 (moved), we (nickm and I) discussed what would be the way to collect and gather those statistics and measurements in a private network for performance analysis and debugging.
This would be completely deactivated at compile time meaning tracepoints would be NOP. You would have to explicitly enable that feature during the configure process.
We think the best way to go with that, in terms of code, is to go in a header with something that could look like this:
#ifdef TOR_USE_LTTNG tracepoint_aname(arg1, arg2, [...]) tracepoint(aname, arg1, arg2, ...) #else tracepoint_aname(arg1, arg2, [...]) #endif
The really good thing about this approach is that 1) everything is centralized in one place, 2) you NOP the call if not configured thus no performance issue, 3) We can support lots of different tracers as well as shadow. It provides a simple way to hook any other tool in the trace event facility of the code.