8346082: Output JVMTI agent information in hserr files
Reviewed-by: mdoerr, dholmes, stuefe
This commit is contained in:
parent
51662c2384
commit
c75b1d4bf6
@ -61,7 +61,6 @@ class JvmtiAgentList : AllStatic {
|
||||
private:
|
||||
static JvmtiAgent* _list;
|
||||
|
||||
static Iterator all();
|
||||
static void initialize();
|
||||
static void convert_xrun_agents();
|
||||
|
||||
@ -82,6 +81,7 @@ class JvmtiAgentList : AllStatic {
|
||||
|
||||
static JvmtiAgent* lookup(JvmtiEnv* env, void* f_ptr);
|
||||
|
||||
static Iterator all();
|
||||
static Iterator agents() NOT_JVMTI({ Iterator it; return it; });
|
||||
static Iterator java_agents();
|
||||
static Iterator native_agents();
|
||||
|
@ -49,6 +49,7 @@
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "prims/jvm_misc.hpp"
|
||||
#include "prims/jvmtiAgent.hpp"
|
||||
#include "prims/jvmtiAgentList.hpp"
|
||||
#include "runtime/arguments.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/frame.inline.hpp"
|
||||
@ -1121,6 +1122,31 @@ void os::print_environment_variables(outputStream* st, const char** env_list) {
|
||||
}
|
||||
}
|
||||
|
||||
void os::print_jvmti_agent_info(outputStream* st) {
|
||||
#if INCLUDE_JVMTI
|
||||
const JvmtiAgentList::Iterator it = JvmtiAgentList::all();
|
||||
if (it.has_next()) {
|
||||
st->print_cr("JVMTI agents:");
|
||||
} else {
|
||||
st->print_cr("JVMTI agents: none");
|
||||
}
|
||||
while (it.has_next()) {
|
||||
const JvmtiAgent* agent = it.next();
|
||||
if (agent != nullptr) {
|
||||
const char* dyninfo = agent->is_dynamic() ? "dynamic " : "";
|
||||
const char* instrumentinfo = agent->is_instrument_lib() ? "instrumentlib " : "";
|
||||
const char* loadinfo = agent->is_loaded() ? "loaded" : "not loaded";
|
||||
const char* initinfo = agent->is_initialized() ? "initialized" : "not initialized";
|
||||
const char* optionsinfo = agent->options();
|
||||
const char* pathinfo = agent->os_lib_path();
|
||||
if (optionsinfo == nullptr) optionsinfo = "none";
|
||||
if (pathinfo == nullptr) pathinfo = "none";
|
||||
st->print_cr("%s path:%s, %s, %s, %s%soptions:%s", agent->name(), pathinfo, loadinfo, initinfo, dyninfo, instrumentinfo, optionsinfo);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void os::print_register_info(outputStream* st, const void* context) {
|
||||
int continuation = 0;
|
||||
print_register_info(st, context, continuation);
|
||||
|
@ -813,6 +813,7 @@ class os: AllStatic {
|
||||
static void print_summary_info(outputStream* st, char* buf, size_t buflen);
|
||||
static void print_memory_info(outputStream* st);
|
||||
static void print_dll_info(outputStream* st);
|
||||
static void print_jvmti_agent_info(outputStream* st);
|
||||
static void print_environment_variables(outputStream* st, const char** env_list);
|
||||
static void print_context(outputStream* st, const void* context);
|
||||
static void print_tos_pc(outputStream* st, const void* context);
|
||||
|
@ -1207,6 +1207,12 @@ void VMError::report(outputStream* st, bool _verbose) {
|
||||
os::print_dll_info(st);
|
||||
st->cr();
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
STEP_IF("printing jvmti agent info", _verbose)
|
||||
os::print_jvmti_agent_info(st);
|
||||
st->cr();
|
||||
#endif
|
||||
|
||||
STEP_IF("printing native decoder state", _verbose)
|
||||
Decoder::print_state_on(st);
|
||||
st->cr();
|
||||
@ -1385,6 +1391,11 @@ void VMError::print_vm_info(outputStream* st) {
|
||||
os::print_dll_info(st);
|
||||
st->cr();
|
||||
|
||||
#if INCLUDE_JVMTI
|
||||
os::print_jvmti_agent_info(st);
|
||||
st->cr();
|
||||
#endif
|
||||
|
||||
// STEP("printing VM options")
|
||||
|
||||
// VM options
|
||||
|
Loading…
x
Reference in New Issue
Block a user