diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-06-21 12:02:14 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-06-21 13:14:14 -0400 |
commit | 4bdda6d05faf24b4ff46bfcb7e40fb5d21e51259 (patch) | |
tree | 37e8b0fc3cb748365d3dddbe8984dd27386f49c9 /src/trace | |
parent | 03d78126152bc79c82a4510fa654bb5a23c150cd (diff) | |
download | tor-4bdda6d05faf24b4ff46bfcb7e40fb5d21e51259.tar.gz tor-4bdda6d05faf24b4ff46bfcb7e40fb5d21e51259.zip |
Move trace into its own library in libs.
Apparently it has no testing variant.
Diffstat (limited to 'src/trace')
-rw-r--r-- | src/trace/debug.h | 25 | ||||
-rw-r--r-- | src/trace/events.h | 45 | ||||
-rw-r--r-- | src/trace/include.am | 19 | ||||
-rw-r--r-- | src/trace/trace.c | 11 | ||||
-rw-r--r-- | src/trace/trace.h | 10 |
5 files changed, 0 insertions, 110 deletions
diff --git a/src/trace/debug.h b/src/trace/debug.h deleted file mode 100644 index 0241f2ccf8..0000000000 --- a/src/trace/debug.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (c) 2017-2018, The Tor Project, Inc. */ -/* See LICENSE for licensing information */ - -#ifndef TOR_TRACE_LOG_DEBUG_H -#define TOR_TRACE_LOG_DEBUG_H - -#include "common/torlog.h" - -/* Stringify pre-processor trick. */ -#define XSTR(d) STR(d) -#define STR(s) #s - -/* Send every event to a debug log level. This is useful to debug new trace - * events without implementing them for a specific event tracing framework. - * Note that the arguments are ignored since at this step we do not know the - * types and amount there is. */ - -/* Example on how to map a tracepoint to log_debug(). */ -#undef tor_trace -#define tor_trace(subsystem, name, args...) \ - log_debug(LD_GENERAL, "Trace event \"" XSTR(name) "\" from " \ - "\"" XSTR(subsystem) "\" hit. " \ - "(line "XSTR(__LINE__) ")") - -#endif /* TOR_TRACE_LOG_DEBUG_H */ diff --git a/src/trace/events.h b/src/trace/events.h deleted file mode 100644 index 761a0f4eb8..0000000000 --- a/src/trace/events.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2017-2018, The Tor Project, Inc. */ -/* See LICENSE for licensing information */ - -/** - * \file events.h - * \brief Header file for Tor event tracing. - **/ - -#ifndef TOR_TRACE_EVENTS_H -#define TOR_TRACE_EVENTS_H - -/* - * The following defines a generic event tracing function name that has to be - * used to trace events in the code base. - * - * That generic function is then defined by a event tracing framework. For - * instance, the "log debug" framework sends all trace events to log_debug() - * which is defined in src/trace/debug.h which can only be enabled at compile - * time (--enable-event-tracing-debug). - * - * By default, every trace events in the code base are replaced by a NOP. See - * doc/HACKING/Tracing.md for more information on how to use event tracing or - * add events. - */ - -#ifdef TOR_EVENT_TRACING_ENABLED -/* Map every trace event to a per subsystem macro. */ -#define tor_trace(subsystem, name, ...) \ - tor_trace_##subsystem(name, __VA_ARGS__) - -/* Enable event tracing for the debug framework where all trace events are - * mapped to a log_debug(). */ -#ifdef USE_EVENT_TRACING_DEBUG -#include "trace/debug.h" -#endif - -#else /* TOR_EVENT_TRACING_ENABLED */ - -/* Reaching this point, we NOP every event declaration because event tracing - * is not been enabled at compile time. */ -#define tor_trace(subsystem, name, args...) - -#endif /* TOR_EVENT_TRACING_ENABLED */ - -#endif /* TOR_TRACE_EVENTS_H */ diff --git a/src/trace/include.am b/src/trace/include.am deleted file mode 100644 index 5e5eaaf9b5..0000000000 --- a/src/trace/include.am +++ /dev/null @@ -1,19 +0,0 @@ - -noinst_LIBRARIES += \ - src/trace/libor-trace.a -LIBOR_TRACE_A_SOURCES = \ - src/trace/trace.c - -TRACEHEADERS = \ - src/trace/trace.h \ - src/trace/events.h - -if USE_EVENT_TRACING_DEBUG -TRACEHEADERS += \ - src/trace/debug.h -endif - -# Library source files. -src_trace_libor_trace_a_SOURCES = $(LIBOR_TRACE_A_SOURCES) - -noinst_HEADERS+= $(TRACEHEADERS) diff --git a/src/trace/trace.c b/src/trace/trace.c deleted file mode 100644 index b39a2bbc5c..0000000000 --- a/src/trace/trace.c +++ /dev/null @@ -1,11 +0,0 @@ -/* Copyright (c) 2017-2018, The Tor Project, Inc. */ -/* See LICENSE for licensing information */ - -#include "trace/trace.h" - -/** Initialize the tracing library. */ -void -tor_trace_init(void) -{ -} - diff --git a/src/trace/trace.h b/src/trace/trace.h deleted file mode 100644 index 2dd51aace1..0000000000 --- a/src/trace/trace.h +++ /dev/null @@ -1,10 +0,0 @@ -/* Copyright (c) 2017-2018, The Tor Project, Inc. */ -/* See LICENSE for licensing information */ - -#ifndef TOR_TRACE_TRACE_H -#define TOR_TRACE_TRACE_H - -void tor_trace_init(void); - -#endif // TOR_TRACE_TRACE_H - |