diff options
author | Jiri Olsa <jolsa@kernel.org> | 2016-11-02 14:35:49 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-11-14 16:42:47 +0100 |
commit | d4dfdf00d43e017dc57372566ceba0e5e1595eba (patch) | |
tree | 7ccdb70893863239efd54dcb12b2a8396ba4bdb8 /tools/perf/Makefile.config | |
parent | tools build: Add jvmti feature detection support (diff) | |
download | linux-d4dfdf00d43e017dc57372566ceba0e5e1595eba.tar.xz linux-d4dfdf00d43e017dc57372566ceba0e5e1595eba.zip |
perf jvmti: Plug compilation into perf build
Compile jvmti agent as part of the perf build. The agent library is
called libperf-jvmti.so and is installed in default place together with
other files:
$ make libperf-jvmti.so
BUILD: Doing 'make -j4' parallel build
...
CC jvmti/libjvmti.o
CC jvmti/jvmti_agent.o
LD jvmti/jvmti-in.o
LINK libperf-jvmti.so
$ make DESTDIR=/tmp/krava/ install-bin
...
$ find /tmp/krava/ | grep libperf
/tmp/krava/lib64/libperf-jvmti.so
/tmp/krava/lib64/libperf-gtk.so
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Stephane Eranian <eranian@google.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: William Cohen <wcohen@redhat.com>
Link: http://lkml.kernel.org/r/1478093749-5602-4-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/Makefile.config')
-rw-r--r-- | tools/perf/Makefile.config | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index cffdd9cf3ebf..8a493d46fab9 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -758,6 +758,31 @@ ifndef NO_AUXTRACE endif endif +ifndef NO_JVMTI + ifneq (,$(wildcard /usr/sbin/update-java-alternatives)) + JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | awk '{print $$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 + $(warning No alternatives command found, you need to set JDIR= to point to the root of your Java directory) + NO_JVMTI := 1 + endif +endif + +ifndef NO_JVMTI + FEATURE_CHECK_CFLAGS-jvmti := -I$(JDIR)/include -I$(JDIR)/include/linux + $(call feature_check,jvmti) + ifeq ($(feature-jvmti), 1) + $(call detected_var,JDIR) + else + $(warning No openjdk development package found, please install JDK package) + NO_JVMTI := 1 + endif +endif + # Among the variables below, these: # perfexecdir # template_dir @@ -850,6 +875,7 @@ ifeq ($(VF),1) $(call print_var,sysconfdir) $(call print_var,LIBUNWIND_DIR) $(call print_var,LIBDW_DIR) + $(call print_var,JDIR) ifeq ($(dwarf-post-unwind),1) $(call feature_print_text,"DWARF post unwind library", $(dwarf-post-unwind-text)) |