diff options
author | 2019-03-05 13:32:49 -0800 | |
---|---|---|
committer | 2019-03-08 04:07:45 +0000 | |
commit | 60ee778ea7cff778f95fafe63138f336def9fb18 (patch) | |
tree | 4b7222ad056b0856c73a4fd65fe6f49d571062fa /openjdkjvmti/ti_extension.cc | |
parent | 334630ee9dffdd1932c1ee641d938f25362a4c1a (diff) |
Add extension and agent for dumping internal jvmti plugin data.
When debugging openjdkjvmti plugin issues it can be useful to dump
internal state somewhere it can be examined. This adds a new extension
method that will let agents get a view of the deopt state of the
plugin and an agent that prints this information to LOG(INFO) on
SIGQUIT.
Test: ./test.py --host
Change-Id: Ia265a5bcca31a2df5ac930ddc2ecffb57d3db911
Diffstat (limited to 'openjdkjvmti/ti_extension.cc')
-rw-r--r-- | openjdkjvmti/ti_extension.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/openjdkjvmti/ti_extension.cc b/openjdkjvmti/ti_extension.cc index 5d398844b2..f12cb0a380 100644 --- a/openjdkjvmti/ti_extension.cc +++ b/openjdkjvmti/ti_extension.cc @@ -38,6 +38,7 @@ #include "ti_allocator.h" #include "ti_class.h" #include "ti_ddms.h" +#include "ti_dump.h" #include "ti_heap.h" #include "ti_logging.h" #include "ti_monitor.h" @@ -312,6 +313,20 @@ jvmtiError ExtensionUtil::GetExtensionFunctions(jvmtiEnv* env, return error; } + // DumpInternalState + error = add_extension( + reinterpret_cast<jvmtiExtensionFunction>(DumpUtil::DumpInternalState), + "com.android.art.misc.get_plugin_internal_state", + "Gets internal state about the plugin and serializes it to the given msg. " + "There is no particular format to this message beyond being human readable.", + { + { "msg", JVMTI_KIND_ALLOC_BUF, JVMTI_TYPE_CCHAR, false }, + }, + { ERR(NULL_POINTER) }); + if (error != ERR(NONE)) { + return error; + } + // Copy into output buffer. *extension_count_ptr = ext_vector.size(); |