X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=liblttng-ust-java-agent%2Fjni%2Fjul%2Flttng_ust_jul.c;h=5acff312f9cbcfad8bdf26adad83bf2bd362eb1c;hb=21ddb8ec9689e02944dae9cd4e5aba1ca2ab0d5b;hp=62d820b2e3ed45466eeb330b19da1c2812ade159;hpb=8ab5c06b92ac9a06ba2743470a38e4e1cfc6a3c9;p=lttng-ust.git diff --git a/liblttng-ust-java-agent/jni/jul/lttng_ust_jul.c b/liblttng-ust-java-agent/jni/jul/lttng_ust_jul.c index 62d820b2..5acff312 100644 --- a/liblttng-ust-java-agent/jni/jul/lttng_ust_jul.c +++ b/liblttng-ust-java-agent/jni/jul/lttng_ust_jul.c @@ -17,6 +17,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#define _LGPL_SOURCE #include "org_lttng_ust_agent_jul_LttngJulApi.h" #define TRACEPOINT_DEFINE @@ -64,31 +65,39 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_agent_jul_LttngJulApi_tracepointWithCo jlong millis, jint log_level, jint thread_id, - jbyteArray context_info) + jbyteArray context_info_entries, + jbyteArray context_info_strings) { jboolean iscopy; const char *msg_cstr = (*env)->GetStringUTFChars(env, msg, &iscopy); const char *logger_name_cstr = (*env)->GetStringUTFChars(env, logger_name, &iscopy); const char *class_name_cstr = (*env)->GetStringUTFChars(env, class_name, &iscopy); const char *method_name_cstr = (*env)->GetStringUTFChars(env, method_name, &iscopy); - signed char *context_info_array; + signed char *context_info_entries_array; + signed char *context_info_strings_array; /* * Write these to the TLS variables, so that the UST callbacks in * lttng_ust_context.c can access them. */ - context_info_array = (*env)->GetByteArrayElements(env, context_info, &iscopy); - lttng_ust_context_info_tls.ctx = (struct lttng_ust_jni_ctx *) context_info_array; - lttng_ust_context_info_tls.len = (*env)->GetArrayLength(env, context_info); + context_info_entries_array = (*env)->GetByteArrayElements(env, context_info_entries, &iscopy); + lttng_ust_context_info_tls.ctx_entries = (struct lttng_ust_jni_ctx_entry *) context_info_entries_array; + lttng_ust_context_info_tls.ctx_entries_len = (*env)->GetArrayLength(env, context_info_entries); + context_info_strings_array = (*env)->GetByteArrayElements(env, context_info_strings, &iscopy); + lttng_ust_context_info_tls.ctx_strings = context_info_strings_array; + lttng_ust_context_info_tls.ctx_strings_len = (*env)->GetArrayLength(env, context_info_strings); tracepoint(lttng_jul, event, msg_cstr, logger_name_cstr, class_name_cstr, method_name_cstr, millis, log_level, thread_id); - lttng_ust_context_info_tls.ctx = NULL; - lttng_ust_context_info_tls.len = 0; + lttng_ust_context_info_tls.ctx_entries = NULL; + lttng_ust_context_info_tls.ctx_entries_len = 0; + lttng_ust_context_info_tls.ctx_strings = NULL; + lttng_ust_context_info_tls.ctx_strings_len = 0; (*env)->ReleaseStringUTFChars(env, msg, msg_cstr); (*env)->ReleaseStringUTFChars(env, logger_name, logger_name_cstr); (*env)->ReleaseStringUTFChars(env, class_name, class_name_cstr); (*env)->ReleaseStringUTFChars(env, method_name, method_name_cstr); - (*env)->ReleaseByteArrayElements(env, context_info, context_info_array, 0); + (*env)->ReleaseByteArrayElements(env, context_info_entries, context_info_entries_array, 0); + (*env)->ReleaseByteArrayElements(env, context_info_strings, context_info_strings_array, 0); }