/*
- * Copyright (C) 2016 - EfficiOS Inc., Alexandre Montplaisir <alexmonthy@efficios.com>
- * 2016 - EfficiOS Inc., Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ * SPDX-License-Identifier: LGPL-2.1-only
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; only
- * version 2.1 of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ * Copyright (C) 2016 EfficiOS Inc.
+ * Copyright (C) 2016 Alexandre Montplaisir <alexmonthy@efficios.com>
+ * Copyright (C) 2016 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
*/
#include "org_lttng_ust_agent_context_LttngContextApi.h"
#include <string.h>
#include <inttypes.h>
#include <lttng/ust-events.h>
-#include <lttng/ringbuffer-config.h>
-#include <lttng/ust-context-provider.h>
-#include <urcu/tls-compat.h>
+#include <lttng/ringbuffer-context.h>
+#include <ust-context-provider.h>
-#include "helper.h"
+#include "ust-helper.h"
#include "lttng_ust_context.h"
enum lttng_ust_jni_type {
} __attribute__((packed));
/* TLS passing context info from JNI to callbacks. */
-DECLARE_URCU_TLS_IE(struct lttng_ust_jni_tls, lttng_ust_context_info_tls);
+__thread struct lttng_ust_jni_tls lttng_ust_context_info_tls;
static const char *get_ctx_string_at_offset(int32_t offset)
{
return NULL;
}
-static size_t get_size_cb(struct lttng_ctx_field *field, size_t offset)
+static size_t get_size_cb(struct lttng_ust_ctx_field *field, size_t offset)
{
struct lttng_ust_jni_ctx_entry *jctx;
size_t size = 0;
- const char *ctx_name = field->event_field.name;
+ const char *ctx_name = field->event_field->name;
enum lttng_ust_jni_type jni_type;
}
-static void record_cb(struct lttng_ctx_field *field,
+static void record_cb(struct lttng_ust_ctx_field *field,
struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_channel *chan)
{
struct lttng_ust_jni_ctx_entry *jctx;
- const char *ctx_name = field->event_field.name;
+ const char *ctx_name = field->event_field->name;
enum lttng_ust_jni_type jni_type;
char sel_char;
}
}
-static void get_value_cb(struct lttng_ctx_field *field,
- struct lttng_ctx_value *value)
+static void get_value_cb(struct lttng_ust_ctx_field *field,
+ struct lttng_ust_ctx_value *value)
{
struct lttng_ust_jni_ctx_entry *jctx;
- const char *ctx_name = field->event_field.name;
+ const char *ctx_name = field->event_field->name;
enum lttng_ust_jni_type jni_type;
jctx = lookup_ctx_by_name(ctx_name);
if (!provider) {
goto error_provider;
}
+ provider->struct_size = sizeof(*provider);
provider->name = provider_name_cstr;
provider->get_size = get_size_cb;
provider->record = record_cb;