Fix: missing field name refactoring in java agent
[lttng-ust.git] / liblttng-ust-java-agent / jni / common / lttng_ust_context.c
index eeb37ebedda9fd3eb2b4c3a67b355e20d3d0f24d..9c379bcf37820eed2a58eaa1182c7e917cf3acc5 100644 (file)
 #include <string.h>
 #include <inttypes.h>
 #include <lttng/ust-events.h>
-#include <lttng/ringbuffer-config.h>
-#include <lttng/ust-context-provider.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 {
@@ -73,11 +73,11 @@ static struct lttng_ust_jni_ctx_entry *lookup_ctx_by_name(const char *ctx_name)
        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;
 
 
@@ -135,12 +135,12 @@ static size_t get_size_cb(struct lttng_ctx_field *field, size_t offset)
 
 }
 
-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;
 
@@ -256,11 +256,11 @@ static void record_cb(struct lttng_ctx_field *field,
        }
 }
 
-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);
@@ -354,6 +354,7 @@ JNIEXPORT jlong JNICALL Java_org_lttng_ust_agent_context_LttngContextApi_registe
        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;
This page took 0.02391 seconds and 4 git commands to generate.