All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf/jvmti: improve error message in Makefile
@ 2016-02-25  5:27 Stephane Eranian
  2016-02-25 13:45 ` Arnaldo Carvalho de Melo
  2016-02-27  9:39 ` [tip:perf/core] perf jvmti: " tip-bot for Stephane Eranian
  0 siblings, 2 replies; 3+ messages in thread
From: Stephane Eranian @ 2016-02-25  5:27 UTC (permalink / raw)
  To: linux-kernel
  Cc: acme, peterz, mingo, ak, kan.liang, jolsa, namhyung, adrian.hunter

This patch improves the error message given by jvmti Makefile
when the alternatives command cannot be found. It now suggests
the user locates the root of their Java installation and pass it
with JDIR=

Signed-off-by: Stephane Eranian <eranian@google.com>
---
 tools/perf/jvmti/Makefile | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile
index 0277a64b391b..5ce61a1bda9c 100644
--- a/tools/perf/jvmti/Makefile
+++ b/tools/perf/jvmti/Makefile
@@ -35,12 +35,21 @@ 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')
-else
+ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
 JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3)
+else
+  ifneq (,$(wildcard /usr/sbin/alternatives))
+    JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
+  endif
 endif
-
+ifndef JDIR
+$(error Could not find alternatives command, you need to set JDIR= to point to the root of your Java directory)
+else
+  ifeq (,$(wildcard $(JDIR)/include/jvmti.h))
+  $(error the openjdk development package appears to me missing, install and try again)
+  endif
+endif
+$(info Using Java from $(JDIR))
 # -lrt required in 32-bit mode for clock_gettime()
 LIBS=-lelf -lrt
 INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] perf/jvmti: improve error message in Makefile
  2016-02-25  5:27 [PATCH] perf/jvmti: improve error message in Makefile Stephane Eranian
@ 2016-02-25 13:45 ` Arnaldo Carvalho de Melo
  2016-02-27  9:39 ` [tip:perf/core] perf jvmti: " tip-bot for Stephane Eranian
  1 sibling, 0 replies; 3+ messages in thread
From: Arnaldo Carvalho de Melo @ 2016-02-25 13:45 UTC (permalink / raw)
  To: Stephane Eranian
  Cc: linux-kernel, peterz, mingo, ak, kan.liang, jolsa, namhyung,
	adrian.hunter, acme

Em Thu, Feb 25, 2016 at 06:27:36AM +0100, Stephane Eranian escreveu:
> This patch improves the error message given by jvmti Makefile
> when the alternatives command cannot be found. It now suggests
> the user locates the root of their Java installation and pass it
> with JDIR=

Thanks, tested on a RHEL6.7 VM without openjdk packages, works as
advertised.

Applied.

- Arnaldo
 
> Signed-off-by: Stephane Eranian <eranian@google.com>
> ---
>  tools/perf/jvmti/Makefile | 17 +++++++++++++----
>  1 file changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile
> index 0277a64b391b..5ce61a1bda9c 100644
> --- a/tools/perf/jvmti/Makefile
> +++ b/tools/perf/jvmti/Makefile
> @@ -35,12 +35,21 @@ 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')
> -else
> +ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
>  JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3)
> +else
> +  ifneq (,$(wildcard /usr/sbin/alternatives))
> +    JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
> +  endif
>  endif
> -
> +ifndef JDIR
> +$(error Could not find alternatives command, you need to set JDIR= to point to the root of your Java directory)
> +else
> +  ifeq (,$(wildcard $(JDIR)/include/jvmti.h))
> +  $(error the openjdk development package appears to me missing, install and try again)
> +  endif
> +endif
> +$(info Using Java from $(JDIR))
>  # -lrt required in 32-bit mode for clock_gettime()
>  LIBS=-lelf -lrt
>  INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux
> -- 
> 1.9.1

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:perf/core] perf jvmti: improve error message in Makefile
  2016-02-25  5:27 [PATCH] perf/jvmti: improve error message in Makefile Stephane Eranian
  2016-02-25 13:45 ` Arnaldo Carvalho de Melo
@ 2016-02-27  9:39 ` tip-bot for Stephane Eranian
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Stephane Eranian @ 2016-02-27  9:39 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, tglx, adrian.hunter, acme, peterz, jolsa, kan.liang,
	linux-kernel, eranian, namhyung, mingo, ak

Commit-ID:  7e9551bc72201838ebaf388224ff43ddf2b0d853
Gitweb:     http://git.kernel.org/tip/7e9551bc72201838ebaf388224ff43ddf2b0d853
Author:     Stephane Eranian <eranian@google.com>
AuthorDate: Thu, 25 Feb 2016 06:27:36 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Thu, 25 Feb 2016 10:43:28 -0300

perf jvmti: improve error message in Makefile

This patch improves the error message given by jvmti Makefile when the
alternatives command cannot be found. It now suggests the user locates
the root of their Java installation and pass it with JDIR=

Signed-off-by: Stephane Eranian <eranian@google.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/1456378056-18812-1-git-send-email-eranian@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/jvmti/Makefile | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile
index 0277a64..5ce61a1 100644
--- a/tools/perf/jvmti/Makefile
+++ b/tools/perf/jvmti/Makefile
@@ -35,12 +35,21 @@ 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')
-else
+ifneq (,$(wildcard /usr/sbin/update-java-alternatives))
 JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3)
+else
+  ifneq (,$(wildcard /usr/sbin/alternatives))
+    JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g')
+  endif
 endif
-
+ifndef JDIR
+$(error Could not find alternatives command, you need to set JDIR= to point to the root of your Java directory)
+else
+  ifeq (,$(wildcard $(JDIR)/include/jvmti.h))
+  $(error the openjdk development package appears to me missing, install and try again)
+  endif
+endif
+$(info Using Java from $(JDIR))
 # -lrt required in 32-bit mode for clock_gettime()
 LIBS=-lelf -lrt
 INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-27  9:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-25  5:27 [PATCH] perf/jvmti: improve error message in Makefile Stephane Eranian
2016-02-25 13:45 ` Arnaldo Carvalho de Melo
2016-02-27  9:39 ` [tip:perf/core] perf jvmti: " tip-bot for Stephane Eranian

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.