projects
/
lttng-ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: Java application context: pass application context argument to callbacks
[lttng-ust.git]
/
src
/
lib
/
lttng-ust-java-agent
/
jni
/
common
/
lttng_ust_context.c
diff --git
a/src/lib/lttng-ust-java-agent/jni/common/lttng_ust_context.c
b/src/lib/lttng-ust-java-agent/jni/common/lttng_ust_context.c
index 8570b211e753e1ddd4c1469bf502976b56b3649c..5e6add28704a8993759784d9e7268a24fea16aa8 100644
(file)
--- a/
src/lib/lttng-ust-java-agent/jni/common/lttng_ust_context.c
+++ b/
src/lib/lttng-ust-java-agent/jni/common/lttng_ust_context.c
@@
-11,7
+11,7
@@
#include <string.h>
#include <inttypes.h>
#include <lttng/ust-events.h>
#include <string.h>
#include <inttypes.h>
#include <lttng/ust-events.h>
-#include <lttng/ringbuffer-context.h>
+#include <lttng/
ust-
ringbuffer-context.h>
#include <common/ust-context-provider.h>
#include "common/macros.h"
#include <common/ust-context-provider.h>
#include "common/macros.h"
@@
-79,15
+79,16
@@
static struct lttng_ust_jni_ctx_entry *lookup_ctx_by_name(const char *ctx_name)
return NULL;
}
return NULL;
}
-static size_t get_size_cb(void *priv, size_t offset)
+static size_t get_size_cb(void *priv, struct lttng_ust_probe_ctx *probe_ctx __attribute__((unused)),
+ size_t offset)
{
{
+ const struct lttng_ust_app_context *app_ctx = (const struct lttng_ust_app_context *) priv;
+ const char *ctx_name = app_ctx->ctx_name;
struct lttng_ust_jni_ctx_entry *jctx;
size_t size = 0;
struct lttng_ust_jni_ctx_entry *jctx;
size_t size = 0;
- struct lttng_ust_jni_provider *jni_provider = (struct lttng_ust_jni_provider *) priv;
- const char *ctx_name = jni_provider->name;
enum lttng_ust_jni_type jni_type;
enum lttng_ust_jni_type jni_type;
- size += lttng_ust_
lib_
ring_buffer_align(offset, lttng_ust_rb_alignof(char));
+ size += lttng_ust_ring_buffer_align(offset, lttng_ust_rb_alignof(char));
size += sizeof(char); /* tag */
jctx = lookup_ctx_by_name(ctx_name);
if (!jctx) {
size += sizeof(char); /* tag */
jctx = lookup_ctx_by_name(ctx_name);
if (!jctx) {
@@
-99,28
+100,28
@@
static size_t get_size_cb(void *priv, size_t offset)
case JNI_TYPE_NULL:
break;
case JNI_TYPE_INTEGER:
case JNI_TYPE_NULL:
break;
case JNI_TYPE_INTEGER:
- size += lttng_ust_
lib_
ring_buffer_align(offset, lttng_ust_rb_alignof(int32_t));
+ size += lttng_ust_ring_buffer_align(offset, lttng_ust_rb_alignof(int32_t));
size += sizeof(int32_t); /* variant */
break;
case JNI_TYPE_LONG:
size += sizeof(int32_t); /* variant */
break;
case JNI_TYPE_LONG:
- size += lttng_ust_
lib_
ring_buffer_align(offset, lttng_ust_rb_alignof(int64_t));
+ size += lttng_ust_ring_buffer_align(offset, lttng_ust_rb_alignof(int64_t));
size += sizeof(int64_t); /* variant */
break;
case JNI_TYPE_DOUBLE:
size += sizeof(int64_t); /* variant */
break;
case JNI_TYPE_DOUBLE:
- size += lttng_ust_
lib_
ring_buffer_align(offset, lttng_ust_rb_alignof(double));
+ size += lttng_ust_ring_buffer_align(offset, lttng_ust_rb_alignof(double));
size += sizeof(double); /* variant */
break;
case JNI_TYPE_FLOAT:
size += sizeof(double); /* variant */
break;
case JNI_TYPE_FLOAT:
- size += lttng_ust_
lib_
ring_buffer_align(offset, lttng_ust_rb_alignof(float));
+ size += lttng_ust_ring_buffer_align(offset, lttng_ust_rb_alignof(float));
size += sizeof(float); /* variant */
break;
case JNI_TYPE_SHORT:
size += sizeof(float); /* variant */
break;
case JNI_TYPE_SHORT:
- size += lttng_ust_
lib_
ring_buffer_align(offset, lttng_ust_rb_alignof(int16_t));
+ size += lttng_ust_ring_buffer_align(offset, lttng_ust_rb_alignof(int16_t));
size += sizeof(int16_t); /* variant */
break;
case JNI_TYPE_BYTE: /* Fall-through. */
case JNI_TYPE_BOOLEAN:
size += sizeof(int16_t); /* variant */
break;
case JNI_TYPE_BYTE: /* Fall-through. */
case JNI_TYPE_BOOLEAN:
- size += lttng_ust_
lib_
ring_buffer_align(offset, lttng_ust_rb_alignof(char));
+ size += lttng_ust_ring_buffer_align(offset, lttng_ust_rb_alignof(char));
size += sizeof(char); /* variant */
break;
case JNI_TYPE_STRING:
size += sizeof(char); /* variant */
break;
case JNI_TYPE_STRING:
@@
-142,12
+143,13
@@
static size_t get_size_cb(void *priv, size_t offset)
}
static void record_cb(void *priv,
}
static void record_cb(void *priv,
- struct lttng_ust_lib_ring_buffer_ctx *ctx,
+ struct lttng_ust_probe_ctx *probe_ctx __attribute__((unused)),
+ struct lttng_ust_ring_buffer_ctx *ctx,
struct lttng_ust_channel_buffer *lttng_chan_buf)
{
struct lttng_ust_channel_buffer *lttng_chan_buf)
{
+ const struct lttng_ust_app_context *app_ctx = (const struct lttng_ust_app_context *) priv;
+ const char *ctx_name = app_ctx->ctx_name;
struct lttng_ust_jni_ctx_entry *jctx;
struct lttng_ust_jni_ctx_entry *jctx;
- struct lttng_ust_jni_provider *jni_provider = (struct lttng_ust_jni_provider *) priv;
- const char *ctx_name = jni_provider->name;
enum lttng_ust_jni_type jni_type;
char sel_char;
enum lttng_ust_jni_type jni_type;
char sel_char;
@@
-247,11
+249,12
@@
static void record_cb(void *priv,
}
}
}
}
-static void get_value_cb(void *priv, struct lttng_ust_ctx_value *value)
+static void get_value_cb(void *priv, struct lttng_ust_probe_ctx *probe_ctx __attribute__((unused)),
+ struct lttng_ust_ctx_value *value)
{
{
- struct lttng_ust_jni_provider *jni_provider = (struct lttng_ust_jni_provider *) priv;
+ const struct lttng_ust_app_context *app_ctx = (const struct lttng_ust_app_context *) priv;
+ const char *ctx_name = app_ctx->ctx_name;
struct lttng_ust_jni_ctx_entry *jctx;
struct lttng_ust_jni_ctx_entry *jctx;
- const char *ctx_name = jni_provider->name;
enum lttng_ust_jni_type jni_type;
jctx = lookup_ctx_by_name(ctx_name);
enum lttng_ust_jni_type jni_type;
jctx = lookup_ctx_by_name(ctx_name);
This page took
0.024706 seconds
and
4
git commands to generate.