summaryrefslogtreecommitdiff
path: root/tools/perf/jvmti/jvmti_agent.h
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2015-11-30 12:02:23 +0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-02-05 18:33:09 +0300
commit598b7c6919c7bbcc1243009721a01bc12275ff3e (patch)
treea774366184bc50f78d124bdb597965b378ec9a9d /tools/perf/jvmti/jvmti_agent.h
parent209045adc2bbdb2b315fa5539cec54d01cd3e7db (diff)
downloadlinux-598b7c6919c7bbcc1243009721a01bc12275ff3e.tar.xz
perf jit: add source line info support
This patch adds source line information support to perf for jitted code. The source line info must be emitted by the runtime, such as JVMTI. Perf injects extract the source line info from the jitdump file and adds the corresponding .debug_lines section in the ELF image generated for each jitted function. The source line enables matching any address in the profile with a source file and line number. The improvement is visible in perf annotate with the source code displayed alongside the assembly code. The dwarf code leverages the support from OProfile which is also released under GPLv2. Copyright 2007 OProfile authors. Signed-off-by: Stephane Eranian <eranian@google.com> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Carl Love <cel@us.ibm.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: John McCutchan <johnmccutchan@google.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sonny Rao <sonnyrao@chromium.org> Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Link: http://lkml.kernel.org/r/1448874143-7269-5-git-send-email-eranian@google.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/jvmti/jvmti_agent.h')
-rw-r--r--tools/perf/jvmti/jvmti_agent.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/perf/jvmti/jvmti_agent.h b/tools/perf/jvmti/jvmti_agent.h
index 8251a1c5ee3f..bedf5d0ba9ff 100644
--- a/tools/perf/jvmti/jvmti_agent.h
+++ b/tools/perf/jvmti/jvmti_agent.h
@@ -11,16 +11,23 @@
extern "C" {
#endif
+typedef struct {
+ unsigned long pc;
+ int line_number;
+ int discrim; /* discriminator -- 0 for now */
+} jvmti_line_info_t;
+
void *jvmti_open(void);
int jvmti_close(void *agent);
int jvmti_write_code(void *agent, char const *symbol_name,
uint64_t vma, void const *code,
const unsigned int code_size);
+
int jvmti_write_debug_info(void *agent,
uint64_t code,
const char *file,
- jvmtiAddrLocationMap const *map,
- jvmtiLineNumberEntry *tab, jint nr);
+ jvmti_line_info_t *li,
+ int nr_lines);
#if defined(__cplusplus)
}