From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932386AbcBDXDH (ORCPT ); Thu, 4 Feb 2016 18:03:07 -0500 Received: from mail-wm0-f54.google.com ([74.125.82.54]:36016 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757317AbcBDXDB (ORCPT ); Thu, 4 Feb 2016 18:03:01 -0500 MIME-Version: 1.0 In-Reply-To: <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> <20160204215310.GB25196@kernel.org> Date: Thu, 4 Feb 2016 15:02:59 -0800 Message-ID: Subject: Re: [PATCH v8 2/4] perf inject: add jitdump mmap injection support From: Stephane Eranian To: Arnaldo Carvalho de Melo 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 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Feb 4, 2016 at 1:53 PM, Arnaldo Carvalho de Melo wrote: > 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). > I will try on Ubuntu again with the latest JVM. Clearly the environment is different. > 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? > Ubuntu Trusty and Wily. > I'm keeping what I have a perf/jit branch in my git tree. > Ok, I will try it out. Thanks. > > 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