Linux Perf
jvmti_agent.c File Reference
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <limits.h>
#include <fcntl.h>
#include <unistd.h>
#include <time.h>
#include <sys/mman.h>
#include <syscall.h>
#include <err.h>
#include "jvmti_agent.h"
#include "../util/jitdump.h"
Include dependency graph for jvmti_agent.c:

Go to the source code of this file.

Macros

#define JIT_LANG   "java"
 
#define NSEC_PER_SEC   1000000000
 

Functions

static pid_t gettid (void)
 
static int get_e_machine (struct jitheader *hdr)
 
static uint64_t get_arch_timestamp (void)
 
static uint64_t timespec_to_ns (const struct timespec *ts)
 
static uint64_t perf_get_timestamp (void)
 
static int debug_cache_init (void)
 
static int perf_open_marker_file (int fd)
 
static void perf_close_marker_file (void)
 
static void init_arch_timestamp (void)
 
void * jvmti_open (void)
 
int jvmti_close (void *agent)
 
int jvmti_write_code (void *agent, char const *sym, uint64_t vma, void const *code, unsigned int const size)
 
int jvmti_write_debug_info (void *agent, uint64_t code, int nr_lines, jvmti_line_info_t *li, const char *const *file_names)
 

Variables

static char jit_path [PATH_MAX]
 
static void * marker_addr
 
static int use_arch_timestamp
 
static int perf_clk_id = CLOCK_MONOTONIC
 

Macro Definition Documentation

◆ JIT_LANG

#define JIT_LANG   "java"

Definition at line 42 of file jvmti_agent.c.

◆ NSEC_PER_SEC

#define NSEC_PER_SEC   1000000000

Definition at line 101 of file jvmti_agent.c.

Function Documentation

◆ debug_cache_init()

static int debug_cache_init ( void  )
static

Definition at line 127 of file jvmti_agent.c.

Here is the call graph for this function:

◆ get_arch_timestamp()

static uint64_t get_arch_timestamp ( void  )
inlinestatic

Definition at line 88 of file jvmti_agent.c.

◆ get_e_machine()

static int get_e_machine ( struct jitheader hdr)
static

Definition at line 52 of file jvmti_agent.c.

◆ gettid()

static pid_t gettid ( void  )
inlinestatic

Definition at line 47 of file jvmti_agent.c.

◆ init_arch_timestamp()

static void init_arch_timestamp ( void  )
static

Definition at line 216 of file jvmti_agent.c.

Here is the call graph for this function:

◆ jvmti_close()

int jvmti_close ( void *  agent)

Definition at line 301 of file jvmti_agent.c.

Here is the call graph for this function:

◆ jvmti_open()

void* jvmti_open ( void  )

Definition at line 226 of file jvmti_agent.c.

Here is the call graph for this function:

◆ jvmti_write_code()

int jvmti_write_code ( void *  agent,
char const *  sym,
uint64_t  vma,
void const *  code,
unsigned int const  size 
)

Definition at line 329 of file jvmti_agent.c.

Here is the call graph for this function:

◆ jvmti_write_debug_info()

int jvmti_write_debug_info ( void *  agent,
uint64_t  code,
int  nr_lines,
jvmti_line_info_t li,
const char *const *  file_names 
)

Definition at line 387 of file jvmti_agent.c.

Here is the call graph for this function:

◆ perf_close_marker_file()

static void perf_close_marker_file ( void  )
static

Definition at line 201 of file jvmti_agent.c.

◆ perf_get_timestamp()

static uint64_t perf_get_timestamp ( void  )
inlinestatic

Definition at line 111 of file jvmti_agent.c.

Here is the call graph for this function:

◆ perf_open_marker_file()

static int perf_open_marker_file ( int  fd)
static

Definition at line 177 of file jvmti_agent.c.

◆ timespec_to_ns()

static uint64_t timespec_to_ns ( const struct timespec *  ts)
inlinestatic

Definition at line 105 of file jvmti_agent.c.

Variable Documentation

◆ jit_path

char jit_path[PATH_MAX]
static

Definition at line 44 of file jvmti_agent.c.

◆ marker_addr

void* marker_addr
static

Definition at line 45 of file jvmti_agent.c.

◆ perf_clk_id

int perf_clk_id = CLOCK_MONOTONIC
static

Definition at line 102 of file jvmti_agent.c.

◆ use_arch_timestamp

int use_arch_timestamp
static

Definition at line 85 of file jvmti_agent.c.