diff options
author | 2020-02-24 14:31:54 -0800 | |
---|---|---|
committer | 2020-02-25 17:20:07 +0000 | |
commit | 8f95183e07398b31fd922f132b8ed2f64950dd28 (patch) | |
tree | 065562c40fdadbd530279175437c52dc20773c8e /openjdkjvmti/ti_extension.cc | |
parent | eac404b341e40bb72f8d79ee1d1a7173862b438e (diff) |
Add new set_verbose_flag_ext JVMTI Extension
Add a new jvmti extension function
"com.android.art.misc.set_verbose_flag_ext" that enables one to set
(or disable) verbose logging options using strings with the same
format as the '-verbose:' command line flag.
Bug: 144947842
Test: atest CtsJvmtiRunTest1982HostTestCases
Change-Id: Ideb1663f5cacfacaeab8cc180372ef479dfc5829
Diffstat (limited to 'openjdkjvmti/ti_extension.cc')
-rw-r--r-- | openjdkjvmti/ti_extension.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/openjdkjvmti/ti_extension.cc b/openjdkjvmti/ti_extension.cc index 62c6fb24ef..f3f6e18018 100644 --- a/openjdkjvmti/ti_extension.cc +++ b/openjdkjvmti/ti_extension.cc @@ -488,6 +488,27 @@ jvmtiError ExtensionUtil::GetExtensionFunctions(jvmtiEnv* env, LOG(INFO) << "debuggable & jni-type indices are required to implement structural " << "class redefinition extensions."; } + // SetVerboseFlagExt + error = add_extension( + reinterpret_cast<jvmtiExtensionFunction>(LogUtil::SetVerboseFlagExt), + "com.android.art.misc.set_verbose_flag_ext", + "Sets the verbose flags selected by the 'option' c-string. Valid options are anything that" + " would be accepted by the -verbose:<option> runtime flag. The verbose selections are turned" + " on if 'enable' is set to true and disabled otherwise. You may select multiple options at" + " once using commas just like with the -verbose:<option> flag. For example \"class,deopt,gc\"" + " is equivalent to turning on all of the VLOG(class_linker), VLOG(deopt) and VLOG(gc)" + " messages.", + { + { "option", JVMTI_KIND_IN_BUF, JVMTI_TYPE_CCHAR, false }, + { "enable", JVMTI_KIND_IN, JVMTI_TYPE_JBOOLEAN, false }, + }, + { + ERR(NULL_POINTER), + ERR(ILLEGAL_ARGUMENT), + }); + if (error != ERR(NONE)) { + return error; + } // Copy into output buffer. |