perf/jvmti: add check for java alternatives cmd in Makefile
PATCH 1/1 perf/jvmti: add check for java alternatives cmd in Makefile
This patch modifies the jvmti makefile to check if /usr/sbin/java-update-alternatives is present. If so, then use it, if not then use the altenatives command. This helps handle the difference between Ubuntu and Fedora Linux distributions.
--- tools/perf/jvmti/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/jvmti/Makefile +5 -1
@@ -35,8 +35,12 @@ SOLIBEXT=so # The following works at least on fedora 23, you may need the next # line for other distros. +ifeq (,$(wildcard /usr/sbin/update-java-alternatives)) JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') -#JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) +else +JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) +endif + # -lrt required in 32-bit mode for clock_gettime() LIBS=-lelf -lrt INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux
Signature · 1 line
2.5.0
Em Tue, Feb 16, 2016 at 07:37:41AM +0100, Stephane Eranian escreveu:
Quoted 5 lines
This patch modifies the jvmti makefile to check if
/usr/sbin/java-update-alternativesis present. If so, then use it, if not then use the altenatives command. This helps handle the difference between Ubuntu and Fedora Linux distributions.
Thanks, tested and applied.
We need tho to better integrate it with the 'make install' target, so that it gets built and installed, this way it will end up packaged by distros.
That, together with documentation should be enough as a first step to ease usage in a more widespread way.
What do you think?
- Arnaldo
Namhyung Kim
maintainerHi Arnaldo and Stephane,
Quoted 7 lines · Arnaldo Carvalho de Melo
Em Tue, Feb 16, 2016 at 07:37:41AM +0100, Stephane Eranian escreveu:
Quoted 5 lines
This patch modifies the jvmti makefile to check if
/usr/sbin/java-update-alternativesis present. If so, then use it, if not then use the altenatives command. This helps handle the difference between Ubuntu and Fedora Linux distributions.
Quoted 8 lines
Thanks, tested and applied.
We need tho to better integrate it with the 'make install' target, so that it gets built and installed, this way it will end up packaged by distros.
That, together with documentation should be enough as a first step to ease usage in a more widespread way.
It'd be better providing a reasonable default (if possible) or guide to how to setup the JDIR for other distro as well.
Thanks,
Namhyung
Em Tue, Feb 16, 2016 at 11:36:48PM +0900, Namhyung Kim escreveu:
Quoted 16 lines
Hi Arnaldo and Stephane,
Quoted 13 lines · Arnaldo Carvalho de Melo
Em Tue, Feb 16, 2016 at 07:37:41AM +0100, Stephane Eranian escreveu:
Quoted 5 lines
This patch modifies the jvmti makefile to check if
/usr/sbin/java-update-alternativesis present. If so, then use it, if not then use the altenatives command. This helps handle the difference between Ubuntu and Fedora Linux distributions.Thanks, tested and applied.
We need tho to better integrate it with the 'make install' target, so that it gets built and installed, this way it will end up packaged by distros.
Quoted 5 lines
Quoted 2 lines
That, together with documentation should be enough as a first step to ease usage in a more widespread way.
It'd be better providing a reasonable default (if possible) or guide to how to setup the JDIR for other distro as well.
Right, that would be even better. I.e. if it fails finding both, exit with an error, stating that the user needs to figure out where is the JDK files.
- Arnaldo
tip-bot for Stephane Eranian
merge bot[tip:perf/core] perf jvmti: Add check for java alternatives cmd in Makefile
In reply to Stephane Eranianperf jvmti: Add check for java alternatives cmd in Makefile
Commit-ID: d646ae0a73deb0d80792a6a9c0757317ad8049c5 Gitweb: http://git.kernel.org/tip/d646ae0a73deb0d80792a6a9c0757317ad8049c5 Author: Stephane Eranian <[email protected]> AuthorDate: Tue, 16 Feb 2016 07:37:41 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Tue, 16 Feb 2016 17:12:46 -0300
perf jvmti: Add check for java alternatives cmd in Makefile
This patch modifies the jvmti makefile to check if the /usr/sbin/java-update-alternatives utility is present. If so, then use it, if not then use the altenatives command.
This helps handle the difference between Ubuntu and Fedora Linux distributions.
--- tools/perf/jvmti/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
tools/perf/jvmti/Makefile +5 -1
@@ -35,8 +35,12 @@ SOLIBEXT=so # The following works at least on fedora 23, you may need the next # line for other distros. +ifeq (,$(wildcard /usr/sbin/update-java-alternatives)) JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') -#JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) +else +JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) +endif + # -lrt required in 32-bit mode for clock_gettime() LIBS=-lelf -lrt INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux