[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160205135717.GE28242@kernel.org>
Date: Fri, 5 Feb 2016 10:57:17 -0300
From: Arnaldo Carvalho de Melo <acme@...nel.org>
To: Stephane Eranian <eranian@...gle.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...nel.org>,
Andi Kleen <andi@...stfloor.org>, Jiri Olsa <jolsa@...hat.com>,
Namhyung Kim <namhyung@...nel.org>,
Rose Belcher <cel@...ibm.com>,
Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>,
Sonny Rao <sonnyrao@...omium.org>,
John Mccutchan <johnmccutchan@...gle.com>,
David Ahern <dsahern@...il.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Pawel Moll <pawel.moll@....com>
Subject: Re: [PATCH v8 2/4] perf inject: add jitdump mmap injection support
Em Fri, Feb 05, 2016 at 10:51:18AM -0300, Arnaldo Carvalho de Melo escreveu:
> Em Fri, Feb 05, 2016 at 10:47:31AM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Thu, Feb 04, 2016 at 03:02:59PM -0800, Stephane Eranian escreveu:
> > > > I'm keeping what I have a perf/jit branch in my git tree.
> >
> > What am I doing wrong? Continuing to investigate...
> > #7 0x00007fef53f31b3a in strlen () from /lib64/libc.so.6
> > #8 0x00007fef51e8e4c1 in compiled_method_load_cb (jvmti=0x7fef4c003ef0, method=<optimized out>, code_size=520, code_addr=0x7fef3d0ffd00, map_length=<optimized out>,
> > map=0x0, compile_info=0x7fef04019e80) at libjvmti.c:85
>
>
> Ok, this bandaid cured the segfault:
>
>
> -------------------------------------------------------------
> diff --git a/tools/perf/jvmti/libjvmti.c b/tools/perf/jvmti/libjvmti.c
> index 745f20c7b4bd..92ffbe4ff160 100644
> --- a/tools/perf/jvmti/libjvmti.c
> +++ b/tools/perf/jvmti/libjvmti.c
> @@ -82,7 +82,7 @@ compiled_method_load_cb(jvmtiEnv *jvmti,
> * append file name, we use loops and not string ops to avoid modifying
> * class_sign which is used later for the symbol name
> */
> - for (j = 0; i < (PATH_MAX - 1) && j < strlen(file_name); j++, i++)
> + for (j = 0; i < (PATH_MAX - 1) && file_name && j < strlen(file_name); j++, i++)
> fn[i] = file_name[j];
> fn[i] = '\0';
> } else {
> -------------------------------------------------------------
>
> Now:
>
> [acme@...et java]$ java -agentpath:/home/acme/git/linux/tools/perf/jvmti/libjvmti.so hello.java
> java: jvmti: jitdump in /home/acme/.debug/jit/java-jit-20160205.XXdDr2Wr/jit-28322.dump
> Error: Could not find or load main class hello.java
> [acme@...et java]$
>
> Do I need to set CLASSPATH or something? /me tries...
Duh:
[acme@...et java]$ java -agentpath:/home/acme/git/linux/tools/perf/jvmti/libjvmti.so hello
java: jvmti: jitdump in /home/acme/.debug/jit/java-jit-20160205.XXFb472a/jit-28966.dump
Hello, World
[acme@...et java]$
- Arnaldo
Powered by blists - more mailing lists