diff options
author | David Goulet <dgoulet@torproject.org> | 2020-02-11 11:26:04 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-07-08 09:10:08 -0400 |
commit | 0de543aae636e422bc9fa339efa81e8260b77ae4 (patch) | |
tree | 8168f28c340b36fb571b28ff00505fba00ed7781 /src/lib/trace/lttng | |
parent | 668fc70a20c602bb0e74bf0e19589a17bb45b7ae (diff) | |
download | tor-0de543aae636e422bc9fa339efa81e8260b77ae4.tar.gz tor-0de543aae636e422bc9fa339efa81e8260b77ae4.zip |
trace: Add LTTng-UST interface support
No probes at this point. They are per subsystem and thus in later commits.
Part of #32910
Diffstat (limited to 'src/lib/trace/lttng')
-rw-r--r-- | src/lib/trace/lttng/include.am | 3 | ||||
-rw-r--r-- | src/lib/trace/lttng/lttng.h | 28 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/trace/lttng/include.am b/src/lib/trace/lttng/include.am new file mode 100644 index 0000000000..4495ce0900 --- /dev/null +++ b/src/lib/trace/lttng/include.am @@ -0,0 +1,3 @@ +# ADD_C_FILE: INSERT HEADERS HERE. +TRACEHEADERS += \ + src/lib/trace/lttng/lttng.h diff --git a/src/lib/trace/lttng/lttng.h b/src/lib/trace/lttng/lttng.h new file mode 100644 index 0000000000..8ede98bb02 --- /dev/null +++ b/src/lib/trace/lttng/lttng.h @@ -0,0 +1,28 @@ +/* Copyright (c) 2020, The Tor Project, Inc. */ +/* See LICENSE for licensing information */ + +/** + * \file lttng.h + * \brief Header file for lttng.c. + **/ + +#ifndef TOR_TRACE_LTTNG_LTTNG_H +#define TOR_TRACE_LTTNG_LTTNG_H + +#ifdef USE_TRACING_INSTRUMENTATION_LTTNG + +#include <lttng/tracepoint.h> + +/* Map event to an LTTng tracepoint. */ +#define TOR_TRACE_LTTNG(subsystem, event_name, ...) \ + tracepoint(subsystem, event_name, ## __VA_ARGS__) + +#else /* !defined(USE_TRACING_INSTRUMENTATION_LTTNG) */ + +/* NOP event. */ +#define TOR_TRACE_LTTNG(subsystem, event_name, ...) + +#endif /* !defined(USE_TRACING_INSTRUMENTATION_LTTNG) */ + +#endif /* TOR_TRACE_LTTNG_LTTNG_H */ + |