#include <stdio.h>
#include <jvmti.h>
#include <string.h>
#include <stdint.h>
#include <stdlib.h>
#include <errno.h>
#include "opagent.h"
Go to the source code of this file.
Functions | |
static int | handle_error (jvmtiError err, char const *msg, int severe) |
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 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 |
JNIEXPORT jint JNICALL Agent_OnLoad | ( | JavaVM * | jvm, | |
char * | options, | |||
void * | reserved | |||
) |
Definition at line 239 of file libjvmti_oprofile.c.
References agent_hdl, can_get_line_numbers, cb_compiled_method_load(), cb_compiled_method_unload(), cb_dynamic_code_generated(), debug, error(), format(), handle_error(), op_major_version(), op_minor_version(), and op_open_agent().
JNIEXPORT void JNICALL Agent_OnUnload | ( | JavaVM * | jvm | ) |
Definition at line 321 of file libjvmti_oprofile.c.
References agent_hdl, and op_close_agent().
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().
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().
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().
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().
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().
op_agent_t agent_hdl [static] |
Definition at line 39 of file libjvmti_oprofile.c.
Referenced by Agent_OnLoad(), Agent_OnUnload(), cb_compiled_method_load(), cb_compiled_method_unload(), and cb_dynamic_code_generated().
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.