libjvmti_oprofile.c File Reference

#include <stdio.h>
#include <jvmti.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include "opagent.h"
Include dependency graph for libjvmti_oprofile.c:

Go to the source code of this file.

Functions

static int handle_error (jvmtiError err, char const *msg, int severe)
static struct debug_line_infocreate_debug_line_info (jint map_length, jvmtiAddrLocationMap const *map, jint entry_count, jvmtiLineNumberEntry *table_ptr, char const *source_filename)
static void JNICALL cb_compiled_method_load (jvmtiEnv *jvmti, jmethodID method, jint code_size, void const *code_addr, jint map_length, jvmtiAddrLocationMap const *map, void const *compile_info)
static void JNICALL cb_compiled_method_unload (jvmtiEnv *jvmti_env, jmethodID method, void const *code_addr)
static void JNICALL cb_dynamic_code_generated (jvmtiEnv *jvmti_env, char const *name, void const *code_addr, jint code_size)
JNIEXPORT jint JNICALL Agent_OnLoad (JavaVM *jvm, char *options, void *reserved)
JNIEXPORT void JNICALL Agent_OnUnload (JavaVM *jvm)

Variables

static int debug = 0
static int can_get_line_numbers = 1
static op_agent_t agent_hdl

Function Documentation

JNIEXPORT jint JNICALL Agent_OnLoad ( JavaVM *  jvm,
char *  options,
void *  reserved 
)
JNIEXPORT void JNICALL Agent_OnUnload ( JavaVM *  jvm  ) 

Definition at line 321 of file libjvmti_oprofile.c.

References agent_hdl, and op_close_agent().

Here is the call graph for this function:

static void JNICALL cb_compiled_method_load ( jvmtiEnv *  jvmti,
jmethodID  method,
jint  code_size,
void const *  code_addr,
jint  map_length,
jvmtiAddrLocationMap const *  map,
void const *  compile_info 
) [static]

Definition at line 115 of file libjvmti_oprofile.c.

References agent_hdl, buf, can_get_line_numbers, cleanup(), create_debug_line_info(), debug, entry_count, handle_error(), op_write_debug_line_info(), and op_write_native_code().

Referenced by Agent_OnLoad().

Here is the call graph for this function:

Here is the caller graph for this function:

static void JNICALL cb_compiled_method_unload ( jvmtiEnv *  jvmti_env,
jmethodID  method,
void const *  code_addr 
) [static]

Definition at line 208 of file libjvmti_oprofile.c.

References agent_hdl, debug, and op_unload_native_code().

Referenced by Agent_OnLoad().

Here is the call graph for this function:

Here is the caller graph for this function:

static void JNICALL cb_dynamic_code_generated ( jvmtiEnv *  jvmti_env,
char const *  name,
void const *  code_addr,
jint  code_size 
) [static]

Definition at line 222 of file libjvmti_oprofile.c.

References agent_hdl, debug, and op_write_native_code().

Referenced by Agent_OnLoad().

Here is the call graph for this function:

Here is the caller graph for this function:

static struct debug_line_info* create_debug_line_info ( jint  map_length,
jvmtiAddrLocationMap const *  map,
jint  entry_count,
jvmtiLineNumberEntry *  table_ptr,
char const *  source_filename 
) [static, read]

returned array is map_length length, params map and map_length != 0 format of lineno information is JVMTI_JLOCATION_JVMBCI, map is an array of { address, code byte index }, table_ptr an array of { byte code index, lineno }

Definition at line 62 of file libjvmti_oprofile.c.

References debug, filename, debug_line_info::filename, debug_line_info::lineno, and debug_line_info::vma.

Referenced by cb_compiled_method_load().

Here is the caller graph for this function:

static int handle_error ( jvmtiError  err,
char const *  msg,
int  severe 
) [static]

Handle an error or a warning, return 0 if the checked error is JVMTI_ERROR_NONE, i.e. success

Definition at line 45 of file libjvmti_oprofile.c.

Referenced by Agent_OnLoad(), and cb_compiled_method_load().

Here is the caller graph for this function:


Variable Documentation

int can_get_line_numbers = 1 [static]

Definition at line 38 of file libjvmti_oprofile.c.

Referenced by Agent_OnLoad(), and cb_compiled_method_load().

int debug = 0 [static]

Definition at line 37 of file libjvmti_oprofile.c.


Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1