* [lttng-dev] [UST PATCH] Build a jar for the Java side of the JNI interface
@ 2012-04-11 19:24 Alexandre Montplaisir
2012-04-11 22:50 ` Mathieu Desnoyers
0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Montplaisir @ 2012-04-11 19:24 UTC (permalink / raw)
Signed-off-by: Alexandre Montplaisir <alexandre.montplaisir at polymtl.ca>
---
liblttng-ust-java/.gitignore | 1 +
liblttng-ust-java/LTTngUst.java | 2 +-
liblttng-ust-java/Makefile.am | 8 ++++++--
liblttng-ust-java/README | 5 +++++
4 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/liblttng-ust-java/.gitignore b/liblttng-ust-java/.gitignore
index 677373e..e07ee50 100644
--- a/liblttng-ust-java/.gitignore
+++ b/liblttng-ust-java/.gitignore
@@ -1,2 +1,3 @@
org_lttng_ust_LTTngUst.h
org/
+liblttng-ust-java.jar
diff --git a/liblttng-ust-java/LTTngUst.java b/liblttng-ust-java/LTTngUst.java
index d3f1eda..68ed120 100644
--- a/liblttng-ust-java/LTTngUst.java
+++ b/liblttng-ust-java/LTTngUst.java
@@ -18,7 +18,7 @@
package org.lttng.ust;
-class LTTngUst {
+public class LTTngUst {
public static native void tracepointString(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 9e01e04..7e1834a 100644
--- a/liblttng-ust-java/Makefile.am
+++ b/liblttng-ust-java/Makefile.am
@@ -7,10 +7,11 @@ liblttng_ust_java_la_SOURCES = LTTngUst.c org_lttng_ust_LTTngUst.h lttng_ust_jav
dist_noinst_DATA = LTTngUst.java
liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust
-all: LTTngUst.class org_lttng_ust_LTTngUst.h
+all: LTTngUst.class org_lttng_ust_LTTngUst.h liblttng-ust-java.jar
clean-local:
- rm org_lttng_ust_LTTngUst.h
+ rm org_lttng_ust_LTTngUst.h
+ rm liblttng-ust-java.jar
rm -rf org/
LTTngUst.class: LTTngUst.java
@@ -19,4 +20,7 @@ LTTngUst.class: LTTngUst.java
org_lttng_ust_LTTngUst.h: LTTngUst.class
javah org.lttng.ust.LTTngUst
+liblttng-ust-java.jar: LTTngUst.class
+ jar cf liblttng-ust-java.jar org/*
+
endif
diff --git a/liblttng-ust-java/README b/liblttng-ust-java/README
index 37834e6..4b4d2c6 100644
--- a/liblttng-ust-java/README
+++ b/liblttng-ust-java/README
@@ -10,3 +10,8 @@ dependency: openjdk-6-jdk
dependency: gcj-4.4-jdk
./configure --with-java-jdk=/usr/lib/jvm/java-gcj --with-jni-interface
+
+
+After building, you can use the liblttng-ust-java.jar file in a Java project.
+It requires the liblttng-ust-java.so* files (which get installed when doing
+`make install') so make sure those are in the linker's library path.
--
1.7.9.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [lttng-dev] [UST PATCH] Build a jar for the Java side of the JNI interface
2012-04-11 19:24 [lttng-dev] [UST PATCH] Build a jar for the Java side of the JNI interface Alexandre Montplaisir
@ 2012-04-11 22:50 ` Mathieu Desnoyers
2012-04-12 2:28 ` Alexandre Montplaisir
0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Desnoyers @ 2012-04-11 22:50 UTC (permalink / raw)
With this, is the java application visible from lttng-tools before the
first JNI call is done ?
* Alexandre Montplaisir (alexandre.montplaisir at polymtl.ca) wrote:
> Signed-off-by: Alexandre Montplaisir <alexandre.montplaisir at polymtl.ca>
> ---
> liblttng-ust-java/.gitignore | 1 +
> liblttng-ust-java/LTTngUst.java | 2 +-
> liblttng-ust-java/Makefile.am | 8 ++++++--
> liblttng-ust-java/README | 5 +++++
> 4 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/liblttng-ust-java/.gitignore b/liblttng-ust-java/.gitignore
> index 677373e..e07ee50 100644
> --- a/liblttng-ust-java/.gitignore
> +++ b/liblttng-ust-java/.gitignore
> @@ -1,2 +1,3 @@
> org_lttng_ust_LTTngUst.h
> org/
> +liblttng-ust-java.jar
> diff --git a/liblttng-ust-java/LTTngUst.java b/liblttng-ust-java/LTTngUst.java
> index d3f1eda..68ed120 100644
> --- a/liblttng-ust-java/LTTngUst.java
> +++ b/liblttng-ust-java/LTTngUst.java
> @@ -18,7 +18,7 @@
>
> package org.lttng.ust;
>
> -class LTTngUst {
> +public class LTTngUst {
> public static native void tracepointString(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 9e01e04..7e1834a 100644
> --- a/liblttng-ust-java/Makefile.am
> +++ b/liblttng-ust-java/Makefile.am
> @@ -7,10 +7,11 @@ liblttng_ust_java_la_SOURCES = LTTngUst.c org_lttng_ust_LTTngUst.h lttng_ust_jav
> dist_noinst_DATA = LTTngUst.java
> liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust
>
> -all: LTTngUst.class org_lttng_ust_LTTngUst.h
> +all: LTTngUst.class org_lttng_ust_LTTngUst.h liblttng-ust-java.jar
>
> clean-local:
> - rm org_lttng_ust_LTTngUst.h
> + rm org_lttng_ust_LTTngUst.h
> + rm liblttng-ust-java.jar
> rm -rf org/
>
> LTTngUst.class: LTTngUst.java
> @@ -19,4 +20,7 @@ LTTngUst.class: LTTngUst.java
> org_lttng_ust_LTTngUst.h: LTTngUst.class
> javah org.lttng.ust.LTTngUst
>
> +liblttng-ust-java.jar: LTTngUst.class
> + jar cf liblttng-ust-java.jar org/*
> +
> endif
> diff --git a/liblttng-ust-java/README b/liblttng-ust-java/README
> index 37834e6..4b4d2c6 100644
> --- a/liblttng-ust-java/README
> +++ b/liblttng-ust-java/README
> @@ -10,3 +10,8 @@ dependency: openjdk-6-jdk
>
> dependency: gcj-4.4-jdk
> ./configure --with-java-jdk=/usr/lib/jvm/java-gcj --with-jni-interface
> +
> +
> +After building, you can use the liblttng-ust-java.jar file in a Java project.
> +It requires the liblttng-ust-java.so* files (which get installed when doing
> +`make install') so make sure those are in the linker's library path.
> --
> 1.7.9.1
>
>
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [lttng-dev] [UST PATCH] Build a jar for the Java side of the JNI interface
2012-04-11 22:50 ` Mathieu Desnoyers
@ 2012-04-12 2:28 ` Alexandre Montplaisir
2012-04-12 13:36 ` Mathieu Desnoyers
0 siblings, 1 reply; 4+ messages in thread
From: Alexandre Montplaisir @ 2012-04-12 2:28 UTC (permalink / raw)
On 12-04-11 06:50 PM, Mathieu Desnoyers wrote:
> With this, is the java application visible from lttng-tools before the
> first JNI call is done ?
No, not yet. This patch only adds the makefile target.
I'm still experimenting with the contents of .java file (namely, adding
support for other tracepoints types). Something like "LTTngUst.init()"
will be needed eventually, since Java classes are lazy-loaded. This
init() can also serve as a check for the liblttng-ust-java.so library,
which will avoid blowing up the application if that library is not found
at runtime.
--
Alexandre Montplaisir
DORSAL lab,
?cole Polytechnique de Montr?al
>
> * Alexandre Montplaisir (alexandre.montplaisir at polymtl.ca) wrote:
>> Signed-off-by: Alexandre Montplaisir <alexandre.montplaisir at polymtl.ca>
>> ---
>> liblttng-ust-java/.gitignore | 1 +
>> liblttng-ust-java/LTTngUst.java | 2 +-
>> liblttng-ust-java/Makefile.am | 8 ++++++--
>> liblttng-ust-java/README | 5 +++++
>> 4 files changed, 13 insertions(+), 3 deletions(-)
>>
>> diff --git a/liblttng-ust-java/.gitignore b/liblttng-ust-java/.gitignore
>> index 677373e..e07ee50 100644
>> --- a/liblttng-ust-java/.gitignore
>> +++ b/liblttng-ust-java/.gitignore
>> @@ -1,2 +1,3 @@
>> org_lttng_ust_LTTngUst.h
>> org/
>> +liblttng-ust-java.jar
>> diff --git a/liblttng-ust-java/LTTngUst.java b/liblttng-ust-java/LTTngUst.java
>> index d3f1eda..68ed120 100644
>> --- a/liblttng-ust-java/LTTngUst.java
>> +++ b/liblttng-ust-java/LTTngUst.java
>> @@ -18,7 +18,7 @@
>>
>> package org.lttng.ust;
>>
>> -class LTTngUst {
>> +public class LTTngUst {
>> public static native void tracepointString(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 9e01e04..7e1834a 100644
>> --- a/liblttng-ust-java/Makefile.am
>> +++ b/liblttng-ust-java/Makefile.am
>> @@ -7,10 +7,11 @@ liblttng_ust_java_la_SOURCES = LTTngUst.c org_lttng_ust_LTTngUst.h lttng_ust_jav
>> dist_noinst_DATA = LTTngUst.java
>> liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust
>>
>> -all: LTTngUst.class org_lttng_ust_LTTngUst.h
>> +all: LTTngUst.class org_lttng_ust_LTTngUst.h liblttng-ust-java.jar
>>
>> clean-local:
>> - rm org_lttng_ust_LTTngUst.h
>> + rm org_lttng_ust_LTTngUst.h
>> + rm liblttng-ust-java.jar
>> rm -rf org/
>>
>> LTTngUst.class: LTTngUst.java
>> @@ -19,4 +20,7 @@ LTTngUst.class: LTTngUst.java
>> org_lttng_ust_LTTngUst.h: LTTngUst.class
>> javah org.lttng.ust.LTTngUst
>>
>> +liblttng-ust-java.jar: LTTngUst.class
>> + jar cf liblttng-ust-java.jar org/*
>> +
>> endif
>> diff --git a/liblttng-ust-java/README b/liblttng-ust-java/README
>> index 37834e6..4b4d2c6 100644
>> --- a/liblttng-ust-java/README
>> +++ b/liblttng-ust-java/README
>> @@ -10,3 +10,8 @@ dependency: openjdk-6-jdk
>>
>> dependency: gcj-4.4-jdk
>> ./configure --with-java-jdk=/usr/lib/jvm/java-gcj --with-jni-interface
>> +
>> +
>> +After building, you can use the liblttng-ust-java.jar file in a Java project.
>> +It requires the liblttng-ust-java.so* files (which get installed when doing
>> +`make install') so make sure those are in the linker's library path.
>> --
>> 1.7.9.1
>>
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev at lists.lttng.org
>> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
^ permalink raw reply [flat|nested] 4+ messages in thread
* [lttng-dev] [UST PATCH] Build a jar for the Java side of the JNI interface
2012-04-12 2:28 ` Alexandre Montplaisir
@ 2012-04-12 13:36 ` Mathieu Desnoyers
0 siblings, 0 replies; 4+ messages in thread
From: Mathieu Desnoyers @ 2012-04-12 13:36 UTC (permalink / raw)
* Alexandre Montplaisir (alexandre.montplaisir at polymtl.ca) wrote:
> On 12-04-11 06:50 PM, Mathieu Desnoyers wrote:
> > With this, is the java application visible from lttng-tools before the
> > first JNI call is done ?
>
> No, not yet. This patch only adds the makefile target.
>
> I'm still experimenting with the contents of .java file (namely, adding
> support for other tracepoints types). Something like "LTTngUst.init()"
> will be needed eventually, since Java classes are lazy-loaded. This
> init() can also serve as a check for the liblttng-ust-java.so library,
> which will avoid blowing up the application if that library is not found
> at runtime.
OK. So I'll pull your patch and expect the fix for init call.
Thanks,
Mathieu
>
>
> --
> Alexandre Montplaisir
> DORSAL lab,
> ?cole Polytechnique de Montr?al
>
>
> >
> > * Alexandre Montplaisir (alexandre.montplaisir at polymtl.ca) wrote:
> >> Signed-off-by: Alexandre Montplaisir <alexandre.montplaisir at polymtl.ca>
> >> ---
> >> liblttng-ust-java/.gitignore | 1 +
> >> liblttng-ust-java/LTTngUst.java | 2 +-
> >> liblttng-ust-java/Makefile.am | 8 ++++++--
> >> liblttng-ust-java/README | 5 +++++
> >> 4 files changed, 13 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/liblttng-ust-java/.gitignore b/liblttng-ust-java/.gitignore
> >> index 677373e..e07ee50 100644
> >> --- a/liblttng-ust-java/.gitignore
> >> +++ b/liblttng-ust-java/.gitignore
> >> @@ -1,2 +1,3 @@
> >> org_lttng_ust_LTTngUst.h
> >> org/
> >> +liblttng-ust-java.jar
> >> diff --git a/liblttng-ust-java/LTTngUst.java b/liblttng-ust-java/LTTngUst.java
> >> index d3f1eda..68ed120 100644
> >> --- a/liblttng-ust-java/LTTngUst.java
> >> +++ b/liblttng-ust-java/LTTngUst.java
> >> @@ -18,7 +18,7 @@
> >>
> >> package org.lttng.ust;
> >>
> >> -class LTTngUst {
> >> +public class LTTngUst {
> >> public static native void tracepointString(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 9e01e04..7e1834a 100644
> >> --- a/liblttng-ust-java/Makefile.am
> >> +++ b/liblttng-ust-java/Makefile.am
> >> @@ -7,10 +7,11 @@ liblttng_ust_java_la_SOURCES = LTTngUst.c org_lttng_ust_LTTngUst.h lttng_ust_jav
> >> dist_noinst_DATA = LTTngUst.java
> >> liblttng_ust_java_la_LIBADD = -lc -L$(top_builddir)/liblttng-ust/.libs -llttng-ust
> >>
> >> -all: LTTngUst.class org_lttng_ust_LTTngUst.h
> >> +all: LTTngUst.class org_lttng_ust_LTTngUst.h liblttng-ust-java.jar
> >>
> >> clean-local:
> >> - rm org_lttng_ust_LTTngUst.h
> >> + rm org_lttng_ust_LTTngUst.h
> >> + rm liblttng-ust-java.jar
> >> rm -rf org/
> >>
> >> LTTngUst.class: LTTngUst.java
> >> @@ -19,4 +20,7 @@ LTTngUst.class: LTTngUst.java
> >> org_lttng_ust_LTTngUst.h: LTTngUst.class
> >> javah org.lttng.ust.LTTngUst
> >>
> >> +liblttng-ust-java.jar: LTTngUst.class
> >> + jar cf liblttng-ust-java.jar org/*
> >> +
> >> endif
> >> diff --git a/liblttng-ust-java/README b/liblttng-ust-java/README
> >> index 37834e6..4b4d2c6 100644
> >> --- a/liblttng-ust-java/README
> >> +++ b/liblttng-ust-java/README
> >> @@ -10,3 +10,8 @@ dependency: openjdk-6-jdk
> >>
> >> dependency: gcj-4.4-jdk
> >> ./configure --with-java-jdk=/usr/lib/jvm/java-gcj --with-jni-interface
> >> +
> >> +
> >> +After building, you can use the liblttng-ust-java.jar file in a Java project.
> >> +It requires the liblttng-ust-java.so* files (which get installed when doing
> >> +`make install') so make sure those are in the linker's library path.
> >> --
> >> 1.7.9.1
> >>
> >>
> >> _______________________________________________
> >> lttng-dev mailing list
> >> lttng-dev at lists.lttng.org
> >> http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-12 13:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 19:24 [lttng-dev] [UST PATCH] Build a jar for the Java side of the JNI interface Alexandre Montplaisir
2012-04-11 22:50 ` Mathieu Desnoyers
2012-04-12 2:28 ` Alexandre Montplaisir
2012-04-12 13:36 ` Mathieu Desnoyers
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox