Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1513852 > unrolled thread

[PATCH 0/3] perf tools: Plug jvmti compilation into perf build

Started byJiri Olsa <jolsa@kernel.org>
First post2016-11-02 14:40 +0100
Last post2016-11-15 11:50 +0100
Articles 6 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] perf tools: Plug jvmti compilation into perf build Jiri Olsa <jolsa@kernel.org> - 2016-11-02 14:40 +0100
    Re: [PATCH 0/3] perf tools: Plug jvmti compilation into perf build Jiri Olsa <jolsa@redhat.com> - 2016-11-11 11:00 +0100
      Re: [PATCH 0/3] perf tools: Plug jvmti compilation into perf build Stephane Eranian <eranian@google.com> - 2016-11-11 16:20 +0100
    Re: [PATCH 0/3] perf tools: Plug jvmti compilation into perf build Stephane Eranian <eranian@google.com> - 2016-11-12 00:20 +0100
      [PATCH] perf tools: Remove jvmti/Makefile file Jiri Olsa <jolsa@redhat.com> - 2016-11-12 13:20 +0100
        [tip:perf/core] perf kvmti: Remove unused Makefile file tip-bot for Jiri Olsa <tipbot@zytor.com> - 2016-11-15 11:50 +0100

#1513852 — [PATCH 0/3] perf tools: Plug jvmti compilation into perf build

FromJiri Olsa <jolsa@kernel.org>
Date2016-11-02 14:40 +0100
Subject[PATCH 0/3] perf tools: Plug jvmti compilation into perf build
Message-ID<sz3VM-6U9-17@gated-at.bofh.it>
hi,
adding jvmti compilation under perf build, so it's easy
to put it under rpm.

I plan on updating fedora/rhel perf rpm, to have the jvmti
placed in like:

  $ rpm -qpl build/x86_64/perf-4.8.5-300.fc24.x86_64.rpm | grep jvmti
  /usr/lib64/libperf-jvmti.so

Stephane,
I'm keeping the jvmti/Makefile as I dont fully follow
the need for .lo objects. Please let me know if you'd
be ok with this new way of building jvmti lib.

Also available in:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/fixes

thanks,
jirla


---
Jiri Olsa (3):
      tools build: Add CFLAGS_REMOVE_* support
      tools build: Add jvmti feature detection support
      perf tools: Plug jvmti compilation into perf build

 tools/build/Build.include           |  4 +++-
 tools/build/Documentation/Build.txt |  6 ++++--
 tools/build/feature/Makefile        |  6 +++++-
 tools/build/feature/test-jvmti.c    | 13 +++++++++++++
 tools/perf/Makefile.config          | 26 ++++++++++++++++++++++++++
 tools/perf/Makefile.perf            | 24 +++++++++++++++++++++++-
 tools/perf/jvmti/Build              |  8 ++++++++
 tools/perf/tests/make               |  2 +-
 8 files changed, 83 insertions(+), 6 deletions(-)
 create mode 100644 tools/build/feature/test-jvmti.c
 create mode 100644 tools/perf/jvmti/Build

[toc] | [next] | [standalone]


#1519647

FromJiri Olsa <jolsa@redhat.com>
Date2016-11-11 11:00 +0100
Message-ID<sCgMO-2B1-23@gated-at.bofh.it>
In reply to#1513852
On Wed, Nov 02, 2016 at 02:35:46PM +0100, Jiri Olsa wrote:
> hi,
> adding jvmti compilation under perf build, so it's easy
> to put it under rpm.
> 
> I plan on updating fedora/rhel perf rpm, to have the jvmti
> placed in like:
> 
>   $ rpm -qpl build/x86_64/perf-4.8.5-300.fc24.x86_64.rpm | grep jvmti
>   /usr/lib64/libperf-jvmti.so
> 
> Stephane,
> I'm keeping the jvmti/Makefile as I dont fully follow
> the need for .lo objects. Please let me know if you'd
> be ok with this new way of building jvmti lib.

ping

thanks,
jirka

> 
> Also available in:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
>   perf/fixes
> 
> thanks,
> jirla
> 
> 
> ---
> Jiri Olsa (3):
>       tools build: Add CFLAGS_REMOVE_* support
>       tools build: Add jvmti feature detection support
>       perf tools: Plug jvmti compilation into perf build
> 
>  tools/build/Build.include           |  4 +++-
>  tools/build/Documentation/Build.txt |  6 ++++--
>  tools/build/feature/Makefile        |  6 +++++-
>  tools/build/feature/test-jvmti.c    | 13 +++++++++++++
>  tools/perf/Makefile.config          | 26 ++++++++++++++++++++++++++
>  tools/perf/Makefile.perf            | 24 +++++++++++++++++++++++-
>  tools/perf/jvmti/Build              |  8 ++++++++
>  tools/perf/tests/make               |  2 +-
>  8 files changed, 83 insertions(+), 6 deletions(-)
>  create mode 100644 tools/build/feature/test-jvmti.c
>  create mode 100644 tools/perf/jvmti/Build

[toc] | [prev] | [next] | [standalone]


#1519846

FromStephane Eranian <eranian@google.com>
Date2016-11-11 16:20 +0100
Message-ID<sClMt-5Zj-13@gated-at.bofh.it>
In reply to#1519647
On Fri, Nov 11, 2016 at 1:51 AM, Jiri Olsa <jolsa@redhat.com> wrote:
>
> On Wed, Nov 02, 2016 at 02:35:46PM +0100, Jiri Olsa wrote:
> > hi,
> > adding jvmti compilation under perf build, so it's easy
> > to put it under rpm.
> >
> > I plan on updating fedora/rhel perf rpm, to have the jvmti
> > placed in like:
> >
> >   $ rpm -qpl build/x86_64/perf-4.8.5-300.fc24.x86_64.rpm | grep jvmti
> >   /usr/lib64/libperf-jvmti.so
> >
> > Stephane,
> > I'm keeping the jvmti/Makefile as I dont fully follow
> > the need for .lo objects. Please let me know if you'd
> > be ok with this new way of building jvmti lib.
>
> ping

Sorry for the delay. Will look at this today and get back to you.

>
>
>
> thanks,
> jirka
>
> >
> > Also available in:
> >   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
> >   perf/fixes
> >
> > thanks,
> > jirla
> >
> >
> > ---
> > Jiri Olsa (3):
> >       tools build: Add CFLAGS_REMOVE_* support
> >       tools build: Add jvmti feature detection support
> >       perf tools: Plug jvmti compilation into perf build
> >
> >  tools/build/Build.include           |  4 +++-
> >  tools/build/Documentation/Build.txt |  6 ++++--
> >  tools/build/feature/Makefile        |  6 +++++-
> >  tools/build/feature/test-jvmti.c    | 13 +++++++++++++
> >  tools/perf/Makefile.config          | 26 ++++++++++++++++++++++++++
> >  tools/perf/Makefile.perf            | 24 +++++++++++++++++++++++-
> >  tools/perf/jvmti/Build              |  8 ++++++++
> >  tools/perf/tests/make               |  2 +-
> >  8 files changed, 83 insertions(+), 6 deletions(-)
> >  create mode 100644 tools/build/feature/test-jvmti.c
> >  create mode 100644 tools/perf/jvmti/Build

[toc] | [prev] | [next] | [standalone]


#1520092

FromStephane Eranian <eranian@google.com>
Date2016-11-12 00:20 +0100
Message-ID<sCtgZ-2tk-1@gated-at.bofh.it>
In reply to#1513852
Jiri,

On Wed, Nov 2, 2016 at 6:35 AM, Jiri Olsa <jolsa@kernel.org> wrote:
> hi,
> adding jvmti compilation under perf build, so it's easy
> to put it under rpm.
>
> I plan on updating fedora/rhel perf rpm, to have the jvmti
> placed in like:
>
>   $ rpm -qpl build/x86_64/perf-4.8.5-300.fc24.x86_64.rpm | grep jvmti
>   /usr/lib64/libperf-jvmti.so
>
> Stephane,
> I'm keeping the jvmti/Makefile as I dont fully follow
> the need for .lo objects. Please let me know if you'd
> be ok with this new way of building jvmti lib.
>
Tested the patch on x86_64. With and without NO_JVMTI.
Tried the libperf-jvmti.so on existing test case, got correct results.

I believe you can now remove the jvmti/Makefile, it is not needed
anymore. We must always (and only) build the .so as this library
is meant to be used as a Java agent.

Tested-by: Stephane Eranian <eranian@google.com>

> Also available in:
>   git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
>   perf/fixes
>
> thanks,
> jirla
>
>
> ---
> Jiri Olsa (3):
>       tools build: Add CFLAGS_REMOVE_* support
>       tools build: Add jvmti feature detection support
>       perf tools: Plug jvmti compilation into perf build
>
>  tools/build/Build.include           |  4 +++-
>  tools/build/Documentation/Build.txt |  6 ++++--
>  tools/build/feature/Makefile        |  6 +++++-
>  tools/build/feature/test-jvmti.c    | 13 +++++++++++++
>  tools/perf/Makefile.config          | 26 ++++++++++++++++++++++++++
>  tools/perf/Makefile.perf            | 24 +++++++++++++++++++++++-
>  tools/perf/jvmti/Build              |  8 ++++++++
>  tools/perf/tests/make               |  2 +-
>  8 files changed, 83 insertions(+), 6 deletions(-)
>  create mode 100644 tools/build/feature/test-jvmti.c
>  create mode 100644 tools/perf/jvmti/Build

[toc] | [prev] | [next] | [standalone]


#1520232 — [PATCH] perf tools: Remove jvmti/Makefile file

FromJiri Olsa <jolsa@redhat.com>
Date2016-11-12 13:20 +0100
Subject[PATCH] perf tools: Remove jvmti/Makefile file
Message-ID<sCFrQ-1Yx-11@gated-at.bofh.it>
In reply to#1520092
On Fri, Nov 11, 2016 at 03:18:03PM -0800, Stephane Eranian wrote:
> Jiri,
> 
> On Wed, Nov 2, 2016 at 6:35 AM, Jiri Olsa <jolsa@kernel.org> wrote:
> > hi,
> > adding jvmti compilation under perf build, so it's easy
> > to put it under rpm.
> >
> > I plan on updating fedora/rhel perf rpm, to have the jvmti
> > placed in like:
> >
> >   $ rpm -qpl build/x86_64/perf-4.8.5-300.fc24.x86_64.rpm | grep jvmti
> >   /usr/lib64/libperf-jvmti.so
> >
> > Stephane,
> > I'm keeping the jvmti/Makefile as I dont fully follow
> > the need for .lo objects. Please let me know if you'd
> > be ok with this new way of building jvmti lib.
> >
> Tested the patch on x86_64. With and without NO_JVMTI.
> Tried the libperf-jvmti.so on existing test case, got correct results.
> 
> I believe you can now remove the jvmti/Makefile, it is not needed
> anymore. We must always (and only) build the .so as this library
> is meant to be used as a Java agent.
> 
> Tested-by: Stephane Eranian <eranian@google.com>

great, attaching the removal patch

Arnaldo,
I rebased my perf/fixes branch, it also contains attached patch

thanks,
jirka


---
Now when jvmti compilation is plugged into Makefile.perf,
there's no need for this makefile.

Link: http://lkml.kernel.org/n/tip-qqz5y4auujk02u888to7cqpn@git.kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
 tools/perf/jvmti/Makefile | 89 -----------------------------------------------
 1 file changed, 89 deletions(-)
 delete mode 100644 tools/perf/jvmti/Makefile

diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile
deleted file mode 100644
index df14e6b67b63..000000000000
--- a/tools/perf/jvmti/Makefile
+++ /dev/null
@@ -1,89 +0,0 @@
-ARCH=$(shell uname -m)
-
-ifeq ($(ARCH), x86_64)
-JARCH=amd64
-endif
-ifeq ($(ARCH), armv7l)
-JARCH=armhf
-endif
-ifeq ($(ARCH), armv6l)
-JARCH=armhf
-endif
-ifeq ($(ARCH), aarch64)
-JARCH=aarch64
-endif
-ifeq ($(ARCH), ppc64)
-JARCH=powerpc
-endif
-ifeq ($(ARCH), ppc64le)
-JARCH=powerpc
-endif
-
-DESTDIR=/usr/local
-
-VERSION=1
-REVISION=0
-AGE=0
-
-LN=ln -sf
-RM=rm
-
-SLIBJVMTI=libjvmti.so.$(VERSION).$(REVISION).$(AGE)
-VLIBJVMTI=libjvmti.so.$(VERSION)
-SLDFLAGS=-shared -Wl,-soname -Wl,$(VLIBJVMTI)
-SOLIBEXT=so
-
-# The following works at least on fedora 23, you may need the next
-# line for other distros.
-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
-$(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
-
-TARGETS=$(SLIBJVMTI)
-
-SRCS=libjvmti.c jvmti_agent.c
-OBJS=$(SRCS:.c=.o)
-SOBJS=$(OBJS:.o=.lo)
-OPT=-O2 -g -Werror -Wall
-
-CFLAGS=$(INCDIR) $(OPT)
-
-all: $(TARGETS)
-
-.c.o:
-	$(CC) $(CFLAGS) -c $*.c
-.c.lo:
-	$(CC) -fPIC -DPIC $(CFLAGS) -c $*.c -o $*.lo
-
-$(OBJS) $(SOBJS): Makefile jvmti_agent.h ../util/jitdump.h
-
-$(SLIBJVMTI):  $(SOBJS)
-	$(CC) $(CFLAGS) $(SLDFLAGS)  -o $@ $(SOBJS) $(LIBS)
-	$(LN) $@ libjvmti.$(SOLIBEXT)
-
-clean:
-	$(RM) -f *.o *.so.* *.so *.lo
-
-install:
-	-mkdir -p $(DESTDIR)/lib
-	install -m 755 $(SLIBJVMTI) $(DESTDIR)/lib/
-	(cd $(DESTDIR)/lib; $(LN) $(SLIBJVMTI) $(VLIBJVMTI))
-	(cd $(DESTDIR)/lib; $(LN) $(SLIBJVMTI) libjvmti.$(SOLIBEXT))
-	ldconfig
-
-.SUFFIXES: .c .S .o .lo
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1522564 — [tip:perf/core] perf kvmti: Remove unused Makefile file

Fromtip-bot for Jiri Olsa <tipbot@zytor.com>
Date2016-11-15 11:50 +0100
Subject[tip:perf/core] perf kvmti: Remove unused Makefile file
Message-ID<sDJto-3Nv-53@gated-at.bofh.it>
In reply to#1520232
Commit-ID:  8c9c3d2f950cca57f5fa9330c4d15d8f0dfda092
Gitweb:     http://git.kernel.org/tip/8c9c3d2f950cca57f5fa9330c4d15d8f0dfda092
Author:     Jiri Olsa <jolsa@redhat.com>
AuthorDate: Sat, 12 Nov 2016 13:10:16 +0100
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 14 Nov 2016 12:42:56 -0300

perf kvmti: Remove unused Makefile file

Now when jvmti compilation is plugged into Makefile.perf, there's no
need for this makefile.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Acked-by: Stephane Eranian <eranian@google.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
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/20161112121016.GA17194@krava
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/jvmti/Makefile | 89 -----------------------------------------------
 1 file changed, 89 deletions(-)

diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile
deleted file mode 100644
index df14e6b..0000000
--- a/tools/perf/jvmti/Makefile
+++ /dev/null
@@ -1,89 +0,0 @@
-ARCH=$(shell uname -m)
-
-ifeq ($(ARCH), x86_64)
-JARCH=amd64
-endif
-ifeq ($(ARCH), armv7l)
-JARCH=armhf
-endif
-ifeq ($(ARCH), armv6l)
-JARCH=armhf
-endif
-ifeq ($(ARCH), aarch64)
-JARCH=aarch64
-endif
-ifeq ($(ARCH), ppc64)
-JARCH=powerpc
-endif
-ifeq ($(ARCH), ppc64le)
-JARCH=powerpc
-endif
-
-DESTDIR=/usr/local
-
-VERSION=1
-REVISION=0
-AGE=0
-
-LN=ln -sf
-RM=rm
-
-SLIBJVMTI=libjvmti.so.$(VERSION).$(REVISION).$(AGE)
-VLIBJVMTI=libjvmti.so.$(VERSION)
-SLDFLAGS=-shared -Wl,-soname -Wl,$(VLIBJVMTI)
-SOLIBEXT=so
-
-# The following works at least on fedora 23, you may need the next
-# line for other distros.
-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
-$(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
-
-TARGETS=$(SLIBJVMTI)
-
-SRCS=libjvmti.c jvmti_agent.c
-OBJS=$(SRCS:.c=.o)
-SOBJS=$(OBJS:.o=.lo)
-OPT=-O2 -g -Werror -Wall
-
-CFLAGS=$(INCDIR) $(OPT)
-
-all: $(TARGETS)
-
-.c.o:
-	$(CC) $(CFLAGS) -c $*.c
-.c.lo:
-	$(CC) -fPIC -DPIC $(CFLAGS) -c $*.c -o $*.lo
-
-$(OBJS) $(SOBJS): Makefile jvmti_agent.h ../util/jitdump.h
-
-$(SLIBJVMTI):  $(SOBJS)
-	$(CC) $(CFLAGS) $(SLDFLAGS)  -o $@ $(SOBJS) $(LIBS)
-	$(LN) $@ libjvmti.$(SOLIBEXT)
-
-clean:
-	$(RM) -f *.o *.so.* *.so *.lo
-
-install:
-	-mkdir -p $(DESTDIR)/lib
-	install -m 755 $(SLIBJVMTI) $(DESTDIR)/lib/
-	(cd $(DESTDIR)/lib; $(LN) $(SLIBJVMTI) $(VLIBJVMTI))
-	(cd $(DESTDIR)/lib; $(LN) $(SLIBJVMTI) libjvmti.$(SOLIBEXT))
-	ldconfig
-
-.SUFFIXES: .c .S .o .lo

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web