+#include <sys/types.h>
+
+/*
+ * Event symbol length. Copied from LTTng kernel ABI.
+ */
+#define LTTNG_SYMBOL_NAME_LEN 256
+
+/*
+ * Every lttng_event_* structure both apply to kernel event and user-space
+ * event.
+ */
+
+/*
+ * Domain types: the different possible tracers.
+ */
+enum lttng_domain_type {
+ LTTNG_DOMAIN_KERNEL = 1,
+ LTTNG_DOMAIN_UST = 2,
+
+ /*
+ * For now, the domains below are not implemented. However, we keep them
+ * here in order to retain their enum values for future development. Note
+ * that it is on the roadmap to implement them.
+ *
+ LTTNG_DOMAIN_UST_EXEC_NAME = 3,
+ LTTNG_DOMAIN_UST_PID = 4,
+ LTTNG_DOMAIN_UST_PID_FOLLOW_CHILDREN = 5,
+ */
+};
+
+/*
+ * Instrumentation type of tracing event.
+ */
+enum lttng_event_type {
+ LTTNG_EVENT_ALL = -1,
+ LTTNG_EVENT_TRACEPOINT = 0,
+ LTTNG_EVENT_PROBE = 1,
+ LTTNG_EVENT_FUNCTION = 2,
+ LTTNG_EVENT_FUNCTION_ENTRY = 3,
+ LTTNG_EVENT_NOOP = 4,
+ LTTNG_EVENT_SYSCALL = 5,
+};
+
+/*
+ * Loglevel information.
+ */
+enum lttng_loglevel_type {
+ LTTNG_EVENT_LOGLEVEL_ALL = 0,
+ LTTNG_EVENT_LOGLEVEL_RANGE = 1,
+ LTTNG_EVENT_LOGLEVEL_SINGLE = 2,
+};
+
+/*
+ * Available loglevels.
+ */
+enum lttng_loglevel {
+ LTTNG_LOGLEVEL_EMERG = 0,
+ LTTNG_LOGLEVEL_ALERT = 1,
+ LTTNG_LOGLEVEL_CRIT = 2,
+ LTTNG_LOGLEVEL_ERR = 3,
+ LTTNG_LOGLEVEL_WARNING = 4,
+ LTTNG_LOGLEVEL_NOTICE = 5,
+ LTTNG_LOGLEVEL_INFO = 6,
+ LTTNG_LOGLEVEL_DEBUG_SYSTEM = 7,
+ LTTNG_LOGLEVEL_DEBUG_PROGRAM = 8,
+ LTTNG_LOGLEVEL_DEBUG_PROCESS = 9,
+ LTTNG_LOGLEVEL_DEBUG_MODULE = 10,
+ LTTNG_LOGLEVEL_DEBUG_UNIT = 11,
+ LTTNG_LOGLEVEL_DEBUG_FUNCTION = 12,
+ LTTNG_LOGLEVEL_DEBUG_LINE = 13,
+ LTTNG_LOGLEVEL_DEBUG = 14,
+};
+
+/*
+ * LTTng consumer mode
+ */
+enum lttng_event_output {
+ LTTNG_EVENT_SPLICE = 0,
+ LTTNG_EVENT_MMAP = 1,
+};
+
+/* Event context possible type */
+enum lttng_event_context_type {
+ LTTNG_EVENT_CONTEXT_PID = 0,
+ LTTNG_EVENT_CONTEXT_PERF_COUNTER = 1,
+ LTTNG_EVENT_CONTEXT_PROCNAME = 2,
+ LTTNG_EVENT_CONTEXT_PRIO = 3,
+ LTTNG_EVENT_CONTEXT_NICE = 4,
+ LTTNG_EVENT_CONTEXT_VPID = 5,
+ LTTNG_EVENT_CONTEXT_TID = 6,
+ LTTNG_EVENT_CONTEXT_VTID = 7,
+ LTTNG_EVENT_CONTEXT_PPID = 8,
+ LTTNG_EVENT_CONTEXT_VPPID = 9,
+ LTTNG_EVENT_CONTEXT_PTHREAD_ID = 10,
+};
+
+enum lttng_calibrate_type {
+ LTTNG_CALIBRATE_FUNCTION = 0,
+};
+
+#define LTTNG_DOMAIN_PADDING1 16
+#define LTTNG_DOMAIN_PADDING2 LTTNG_SYMBOL_NAME_LEN + 32
+struct lttng_domain {
+ enum lttng_domain_type type;
+ char padding[LTTNG_DOMAIN_PADDING1];
+
+ union {
+ pid_t pid;
+ char exec_name[NAME_MAX];
+ char padding[LTTNG_DOMAIN_PADDING2];
+ } attr;
+};
+
+/* Perf counter attributes */
+#define LTTNG_PERF_EVENT_PADDING1 16
+struct lttng_event_perf_counter_ctx {
+ uint32_t type;
+ uint64_t config;
+ char name[LTTNG_SYMBOL_NAME_LEN];
+
+ char padding[LTTNG_PERF_EVENT_PADDING1];
+};
+
+/* Event/Channel context */
+#define LTTNG_EVENT_CONTEXT_PADDING1 16
+#define LTTNG_EVENT_CONTEXT_PADDING2 LTTNG_SYMBOL_NAME_LEN + 32
+struct lttng_event_context {
+ enum lttng_event_context_type ctx;
+ char padding[LTTNG_EVENT_CONTEXT_PADDING1];