From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756753AbcBDVxQ (ORCPT ); Thu, 4 Feb 2016 16:53:16 -0500 Received: from mail.kernel.org ([198.145.29.136]:54359 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753143AbcBDVxP (ORCPT ); Thu, 4 Feb 2016 16:53:15 -0500 Date: Thu, 4 Feb 2016 18:53:10 -0300 From: Arnaldo Carvalho de Melo To: Stephane Eranian Cc: LKML , Peter Zijlstra , Ingo Molnar , Andi Kleen , Jiri Olsa , Namhyung Kim , Rose Belcher , Sukadev Bhattiprolu , Sonny Rao , John Mccutchan , David Ahern , Adrian Hunter , Pawel Moll Subject: Re: [PATCH v8 2/4] perf inject: add jitdump mmap injection support Message-ID: <20160204215310.GB25196@kernel.org> References: <1448874143-7269-1-git-send-email-eranian@google.com> <1448874143-7269-3-git-send-email-eranian@google.com> <20160122204405.GB2470@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Fri, Jan 22, 2016 at 01:22:51PM -0800, Stephane Eranian escreveu: > On Fri, Jan 22, 2016 at 12:44 PM, Arnaldo Carvalho de Melo > wrote: > > Em Mon, Nov 30, 2015 at 10:02:21AM +0100, Stephane Eranian escreveu: > >> This patch adds a --jit/-j option to perf inject. > >> > >> This options injects MMAP records into the perf.data > >> file to cover the jitted code mmaps. It also emits > >> ELF images for each function in the jidump file. > >> Those images are created where the jitdump file is. > >> The MMAP records point to that location as well. > >> > >> Typical flow: > >> $ perf record -k mono -- java -agentpath:libpjvmti.so java_class > >> $ perf inject --jit -i perf.data -o perf.data.jitted > >> $ perf report -i perf.data.jitted > > > > So, it fails 'make -C tools/perf build-test', specifically the one where > > we ask for a NO_LIBELF build, trying to fix: > > > I have rebase to tip.git last night. Will try your branch today. > Will add a couple of minor adjustments and also better documentation > on how to use it. So, trying to continue with this, digged for instructions on how to build this the libjvmti.so thing, figure out its java-devel (aka java-1.8.0-openjdk-devel). And I needed this to build it, hacky tho, as was what was there before, BTW, what distro was it you tested this for that update-java-alternatives to be available? I'm keeping what I have a perf/jit branch in my git tree. - Arnaldo diff --git a/tools/perf/jvmti/Makefile b/tools/perf/jvmti/Makefile index 5e46f518e045..d7005f1608d2 100644 --- a/tools/perf/jvmti/Makefile +++ b/tools/perf/jvmti/Makefile @@ -33,7 +33,8 @@ VLIBJVMTI=libjvmti.so.$(VERSION) SLDFLAGS=-shared -Wl,-soname -Wl,$(VLIBJVMTI) SOLIBEXT=so -JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) +#JDIR=$(shell /usr/sbin/update-java-alternatives -l | head -1 | cut -d ' ' -f 3) +JDIR=$(shell alternatives --display java | tail -1 | cut -d' ' -f 5 | sed 's%/jre/bin/java.%%g') # -lrt required in 32-bit mode for clock_gettime() LIBS=-lelf -lrt INCDIR=-I $(JDIR)/include -I $(JDIR)/include/linux