From: compudj Date: Mon, 12 Jun 2006 17:18:46 +0000 (+0000) Subject: java update X-Git-Tag: v0.12.20~1565 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=f77d9b0e4de4aa3a3d9fa8fa7560add3c1aa046d;p=lttv.git java update git-svn-id: http://ltt.polymtl.ca/svn@1924 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/ltt-usertrace/java/TestBrand.java b/ltt-usertrace/java/TestBrand.java index b6cb7c91..6bb7ae66 100644 --- a/ltt-usertrace/java/TestBrand.java +++ b/ltt-usertrace/java/TestBrand.java @@ -1,11 +1,11 @@ -import ThreadBrand; +import ltt.*; // The Sample.java file public class TestBrand { public static void main(String[] args) { - ThreadBrand.trace_java_generic_thread_brand("Brand_test"); + ltt.ThreadBrand.trace_java_generic_thread_brand("Brand_test"); } } diff --git a/ltt-usertrace/java/ThreadBrand.java b/ltt-usertrace/java/ThreadBrand.java index 14a30790..2b6bcdc7 100644 --- a/ltt-usertrace/java/ThreadBrand.java +++ b/ltt-usertrace/java/ThreadBrand.java @@ -1,8 +1,11 @@ + +package ltt; + // The ThreadBrand.java file public class ThreadBrand { // Declaration of the Native (C) function - private static native void trace_java_generic_thread_brand(String arg); + public static native void trace_java_generic_thread_brand(String arg); static { System.loadLibrary("ltt-java-thread_brand"); } diff --git a/ltt-usertrace/java/generate.sh b/ltt-usertrace/java/generate.sh index 78a7b9f0..35fcd7d1 100755 --- a/ltt-usertrace/java/generate.sh +++ b/ltt-usertrace/java/generate.sh @@ -1,8 +1,10 @@ #!/bin/sh +export CLASSPATH=.:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/bin + #Sample javac Sample.java -CLASSPATH=.:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/bin javah -jni Sample +javah -jni Sample gcc -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include \ -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include/linux \ -shared -Wl,-soname,libltt-java-string \ @@ -11,11 +13,17 @@ gcc -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include \ LD_LIBRARY_PATH=. java Sample #TestBrand -javac TestBrand.java -CLASSPATH=.:/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/bin javah -jni TestBrand +echo javac Threadbrand +javac -d . ThreadBrand.java +echo javah Threadbrand +javah -jni ltt.ThreadBrand +echo gcc gcc -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include \ -I /usr/lib/jvm/java-1.5.0-sun-1.5.0.06/include/linux \ -shared -Wl,-soname,libltt-java-thread_brand \ -o libltt-java-thread_brand.so ltt-java-thread_brand.c \ ../ltt-facility-loader-user_generic.c +echo javac test +javac TestBrand.java +echo run LD_LIBRARY_PATH=. java TestBrand diff --git a/ltt-usertrace/java/ltt-java-thread_brand.c b/ltt-usertrace/java/ltt-java-thread_brand.c index aa088405..87041cc1 100644 --- a/ltt-usertrace/java/ltt-java-thread_brand.c +++ b/ltt-usertrace/java/ltt-java-thread_brand.c @@ -8,8 +8,8 @@ #define LTT_BLOCKING 1 #include -JNIEXPORT void JNICALL Java_ThreadBrand_trace_1java_1generic_1thread_brand - (JNIEnv *env, jobject obj, jstring jstr) +JNIEXPORT void JNICALL Java_ltt_ThreadBrand_trace_1java_1generic_1thread_1brand + (JNIEnv *env, jclass jc, jstring jstr) { const char *str; str = (*env)->GetStringUTFChars(env, jstr, NULL);