The JIT support API for OProfile is defined
in <oprofile-install-dir>/include/opagent.h
.
Some parts of the API are mandatory for an agent library to use; other
parts are optional. The mandatory functions are shown below.
op_agent_t op_open_agent(void); void op_close_agent(op_agent_t hdl); int op_write_native_code(op_agent_t hdl, char const * symbol_name, uint64_t vma, const void * code, const unsigned int code_size); |
To implement this part of your library, you must perform the following steps:
op_op_agent()
and cache the returned op_agent_t
handle for use in
future calls.op_write_native_code()
.op_agent_close()
.
Use of the functions below are optional, depending on the kinds of information your VM can provide to your agent library. See the JVMTI agent library for an example of how to use these functions.
int op_unload_native_code(op_agent_t hdl, uint64_t vma); int op_write_debug_line_info(op_agent_t hdl, void const * code, size_t nr_entry, struct debug_line_info const * compile_map); |