From 8bc39f8703eb1189eb9d8b91345a554ccfcb2975 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Wed, 18 Apr 2012 19:05:32 -0400 Subject: [PATCH] Revert "Fix: Make the JNI interface actually work" This reverts commit 46adf653a1d01b8e87baa30cc9b92616eee1a788. It changes the makefiles, and broke make dist. This does not belong in a stable release. Signed-off-by: Mathieu Desnoyers --- liblttng-ust-java/.gitignore | 4 ++-- liblttng-ust-java/{LTTngUst.c => LTTNG_UST.c} | 5 +---- .../{LTTngUst.java => LTTNG_UST.java} | 6 ++---- liblttng-ust-java/Makefile.am | 17 ++++++++--------- 4 files changed, 13 insertions(+), 19 deletions(-) rename liblttng-ust-java/{LTTngUst.c => LTTNG_UST.c} (85%) rename liblttng-ust-java/{LTTngUst.java => LTTNG_UST.java} (88%) diff --git a/liblttng-ust-java/.gitignore b/liblttng-ust-java/.gitignore index 677373ea..ab97d041 100644 --- a/liblttng-ust-java/.gitignore +++ b/liblttng-ust-java/.gitignore @@ -1,2 +1,2 @@ -org_lttng_ust_LTTngUst.h -org/ +UST.class +UST.h diff --git a/liblttng-ust-java/LTTngUst.c b/liblttng-ust-java/LTTNG_UST.c similarity index 85% rename from liblttng-ust-java/LTTngUst.c rename to liblttng-ust-java/LTTNG_UST.c index 3d23d6a1..af29c1e9 100644 --- a/liblttng-ust-java/LTTngUst.c +++ b/liblttng-ust-java/LTTNG_UST.c @@ -22,7 +22,7 @@ #define TRACEPOINT_CREATE_PROBES #include "lttng_ust_java.h" -JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointString(JNIEnv *env, +JNIEXPORT void JNICALL Java_LTTNG_UST_ust_1java_1event (JNIEnv *env, jobject jobj, jstring ev_name, jstring args) @@ -33,7 +33,4 @@ JNIEXPORT void JNICALL Java_org_lttng_ust_LTTngUst_tracepointString(JNIEnv *env, const char *args_cstr = (*env)->GetStringUTFChars(env, args, &iscopy); tracepoint(lttng_ust_java, string, ev_name_cstr, args_cstr); - - (*env)->ReleaseStringUTFChars(env, ev_name, ev_name_cstr); - (*env)->ReleaseStringUTFChars(env, args, args_cstr); } diff --git a/liblttng-ust-java/LTTngUst.java b/liblttng-ust-java/LTTNG_UST.java similarity index 88% rename from liblttng-ust-java/LTTngUst.java rename to liblttng-ust-java/LTTNG_UST.java index d3f1edaf..7ec61103 100644 --- a/liblttng-ust-java/LTTngUst.java +++ b/liblttng-ust-java/LTTNG_UST.java @@ -16,10 +16,8 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -package org.lttng.ust; - -class LTTngUst { - public static native void tracepointString(String name, String arg); +class LTTNG_UST { + public static native void lttng_ust_java_string(String name, String arg); static { System.loadLibrary("lttng-ust-java"); } diff --git a/liblttng-ust-java/Makefile.am b/liblttng-ust-java/Makefile.am index 9e01e045..31915d0d 100644 --- a/liblttng-ust-java/Makefile.am +++ b/liblttng-ust-java/Makefile.am @@ -3,20 +3,19 @@ if BUILD_JNI_INTERFACE AM_CPPFLAGS = -I$(top_srcdir)/include lib_LTLIBRARIES = liblttng-ust-java.la -liblttng_ust_java_la_SOURCES = LTTngUst.c org_lttng_ust_LTTngUst.h lttng_ust_java.h -dist_noinst_DATA = LTTngUst.java +liblttng_ust_java_la_SOURCES = LTTNG_UST.c LTTNG_UST.h lttng_ust_java.h +dist_noinst_DATA = LTTNG_UST.java liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust -all: LTTngUst.class org_lttng_ust_LTTngUst.h +all: LTTNG_UST.class LTTNG_UST.h clean-local: - rm org_lttng_ust_LTTngUst.h - rm -rf org/ + rm -rf LTTNG_UST.h LTTNG_UST.class -LTTngUst.class: LTTngUst.java - javac -d "$(builddir)" "$(srcdir)/LTTngUst.java" +LTTNG_UST.class: LTTNG_UST.java + javac -d "$(builddir)" "$(srcdir)/LTTNG_UST.java" -org_lttng_ust_LTTngUst.h: LTTngUst.class - javah org.lttng.ust.LTTngUst +LTTNG_UST.h: LTTNG_UST.class + javah -classpath ./ -jni LTTNG_UST endif -- 2.34.1