Fix: java agent: migrate to new channel structures
[lttng-ust.git] / liblttng-ust-java-agent / jni / common / lttng_ust_context.c
index 52097896de82904de1bcb73f1f2eb8f3fa50d454..ae478ba3c407c26ccd015ea9a2232454e763c5c7 100644 (file)
@@ -11,7 +11,7 @@
 #include <string.h>
 #include <inttypes.h>
 #include <lttng/ust-events.h>
-#include <lttng/ringbuffer-config.h>
+#include <lttng/ringbuffer-context.h>
 #include <ust-context-provider.h>
 
 #include "ust-helper.h"
@@ -77,7 +77,7 @@ 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;
 
 
@@ -137,10 +137,10 @@ static size_t get_size_cb(struct lttng_ust_ctx_field *field, size_t offset)
 
 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_channel_buffer *lttng_chan_buf)
 {
        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;
 
@@ -155,7 +155,7 @@ static void record_cb(struct lttng_ust_ctx_field *field,
        case JNI_TYPE_NULL:
                sel_char = LTTNG_UST_DYNAMIC_TYPE_NONE;
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
-               chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+               lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
                break;
        case JNI_TYPE_INTEGER:
        {
@@ -163,9 +163,9 @@ static void record_cb(struct lttng_ust_ctx_field *field,
 
                sel_char = LTTNG_UST_DYNAMIC_TYPE_S32;
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
-               chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+               lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
-               chan->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
                break;
        }
        case JNI_TYPE_LONG:
@@ -174,9 +174,9 @@ static void record_cb(struct lttng_ust_ctx_field *field,
 
                sel_char = LTTNG_UST_DYNAMIC_TYPE_S64;
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
-               chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+               lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
-               chan->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
                break;
        }
        case JNI_TYPE_DOUBLE:
@@ -185,9 +185,9 @@ static void record_cb(struct lttng_ust_ctx_field *field,
 
                sel_char = LTTNG_UST_DYNAMIC_TYPE_DOUBLE;
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
-               chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+               lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
-               chan->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
                break;
        }
        case JNI_TYPE_FLOAT:
@@ -196,9 +196,9 @@ static void record_cb(struct lttng_ust_ctx_field *field,
 
                sel_char = LTTNG_UST_DYNAMIC_TYPE_FLOAT;
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
-               chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+               lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
-               chan->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
                break;
        }
        case JNI_TYPE_SHORT:
@@ -207,9 +207,9 @@ static void record_cb(struct lttng_ust_ctx_field *field,
 
                sel_char = LTTNG_UST_DYNAMIC_TYPE_S16;
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
-               chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+               lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
-               chan->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
                break;
        }
        case JNI_TYPE_BYTE:
@@ -218,9 +218,9 @@ static void record_cb(struct lttng_ust_ctx_field *field,
 
                sel_char = LTTNG_UST_DYNAMIC_TYPE_S8;
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
-               chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+               lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
-               chan->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
                break;
        }
        case JNI_TYPE_BOOLEAN:
@@ -229,9 +229,9 @@ static void record_cb(struct lttng_ust_ctx_field *field,
 
                sel_char = LTTNG_UST_DYNAMIC_TYPE_S8;
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
-               chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+               lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
                lib_ring_buffer_align_ctx(ctx, lttng_alignof(v));
-               chan->ops->event_write(ctx, &v, sizeof(v));
+               lttng_chan_buf->ops->event_write(ctx, &v, sizeof(v));
                break;
        }
        case JNI_TYPE_STRING:
@@ -245,9 +245,9 @@ static void record_cb(struct lttng_ust_ctx_field *field,
                                sel_char = LTTNG_UST_DYNAMIC_TYPE_NONE;
                        }
                        lib_ring_buffer_align_ctx(ctx, lttng_alignof(char));
-                       chan->ops->event_write(ctx, &sel_char, sizeof(sel_char));
+                       lttng_chan_buf->ops->event_write(ctx, &sel_char, sizeof(sel_char));
                        if (str) {
-                               chan->ops->event_write(ctx, str, strlen(str) + 1);
+                               lttng_chan_buf->ops->event_write(ctx, str, strlen(str) + 1);
                        }
                        break;
        }
@@ -260,7 +260,7 @@ 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);
This page took 0.026259 seconds and 4 git commands to generate.