int lttng_attach_context(struct lttng_ust_context *context_param,
union ust_args *uargs,
struct lttng_ctx **ctx, struct lttng_session *session);
-int lttng_session_context_init(struct lttng_ctx **ctx);
-
void lttng_transport_register(struct lttng_transport *transport);
void lttng_transport_unregister(struct lttng_transport *transport);
void lttng_enabler_event_link_bytecode(struct lttng_event *event,
struct lttng_enabler *enabler);
void lttng_filter_sync_state(struct lttng_bytecode_runtime *runtime);
+int lttng_session_context_init(struct lttng_ctx **ctx);
+
#ifdef __cplusplus
}
lttng-ust-statedump-provider.h \
ust_lib.c \
ust_lib.h \
+ context-internal.h \
context-provider-internal.h \
tracepoint-internal.h \
ust-events-internal.h \
--- /dev/null
+#ifndef _LTTNG_UST_CONTEXT_INTERNAL_H
+#define _LTTNG_UST_CONTEXT_INTERNAL_H
+
+/*
+ * ust-events-internal.h
+ *
+ * Copyright 2020 (c) - Francis Deslauriers <francis.deslauriers@efficios.com>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <lttng/ust-events.h>
+
+int lttng_context_init_all(struct lttng_ctx **ctx);
+
+#endif /* _LTTNG_UST_CONTEXT_INTERNAL_H */
#include <string.h>
#include <assert.h>
+#include "context-internal.h"
+
/*
* The filter implementation requires that two consecutive "get" for the
* same context performed by the same thread return the same result.
return ret;
}
-int lttng_session_context_init(struct lttng_ctx **ctx)
+int lttng_context_init_all(struct lttng_ctx **ctx)
{
int ret;
void lttng_context_exit(void)
{
}
+
+int lttng_session_context_init(struct lttng_ctx **ctx)
+{
+ return 0;
+}
#include "lttng-tracer.h"
#include "lttng-tracer-core.h"
#include "lttng-ust-statedump.h"
+#include "context-internal.h"
#include "ust-events-internal.h"
#include "wait.h"
#include "../libringbuffer/shm.h"
session = zmalloc(sizeof(struct lttng_session));
if (!session)
return NULL;
- if (lttng_session_context_init(&session->ctx)) {
+ if (lttng_context_init_all(&session->ctx)) {
free(session);
return NULL;
}
if (!event_notifier_group)
return NULL;
+ /* Add all contexts. */
+ if (lttng_context_init_all(&event_notifier_group->ctx)) {
+ free(event_notifier_group);
+ return NULL;
+ }
+
CDS_INIT_LIST_HEAD(&event_notifier_group->enablers_head);
CDS_INIT_LIST_HEAD(&event_notifier_group->event_notifiers_head);
for (i = 0; i < LTTNG_UST_EVENT_NOTIFIER_HT_SIZE; i++)