forked from Minki/linux
598b7c6919
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>
37 lines
741 B
C
37 lines
741 B
C
#ifndef __JVMTI_AGENT_H__
|
|
#define __JVMTI_AGENT_H__
|
|
|
|
#include <sys/types.h>
|
|
#include <stdint.h>
|
|
#include <jvmti.h>
|
|
|
|
#define __unused __attribute__((unused))
|
|
|
|
#if defined(__cplusplus)
|
|
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,
|
|
jvmti_line_info_t *li,
|
|
int nr_lines);
|
|
|
|
#if defined(__cplusplus)
|
|
}
|
|
|
|
#endif
|
|
#endif /* __JVMTI_H__ */
|