8213015: Inconsistent settings between JFR.configure and -XX:FlightRecorderOptions
Reviewed-by: mgronlun, egahlin
This commit is contained in:
parent
f684f2cff3
commit
4663065fad
@ -544,12 +544,12 @@ JfrConfigureFlightRecorderDCmd::JfrConfigureFlightRecorderDCmd(outputStream* out
|
|||||||
bool heap) : DCmdWithParser(output, heap),
|
bool heap) : DCmdWithParser(output, heap),
|
||||||
_repository_path("repositorypath", "Path to repository,.e.g \\\"My Repository\\\"", "STRING", false, NULL),
|
_repository_path("repositorypath", "Path to repository,.e.g \\\"My Repository\\\"", "STRING", false, NULL),
|
||||||
_dump_path("dumppath", "Path to dump,.e.g \\\"My Dump path\\\"", "STRING", false, NULL),
|
_dump_path("dumppath", "Path to dump,.e.g \\\"My Dump path\\\"", "STRING", false, NULL),
|
||||||
_stack_depth("stackdepth", "Stack Depth", "JLONG", false, "64"),
|
_stack_depth("stackdepth", "Stack Depth", "JULONG", false, "64"),
|
||||||
_global_buffer_count("globalbuffercount", "Number of global buffers,", "JLONG", false, "32"),
|
_global_buffer_count("globalbuffercount", "Number of global buffers,", "JULONG", false, "20"),
|
||||||
_global_buffer_size("globalbuffersize", "Size of a global buffers,", "JLONG", false, "524288"),
|
_global_buffer_size("globalbuffersize", "Size of a global buffers,", "MEMORY SIZE", false, "512k"),
|
||||||
_thread_buffer_size("thread_buffer_size", "Size of a thread buffer", "JLONG", false, "8192"),
|
_thread_buffer_size("thread_buffer_size", "Size of a thread buffer", "MEMORY SIZE", false, "8k"),
|
||||||
_memory_size("memorysize", "Overall memory size, ", "JLONG", false, "16777216"),
|
_memory_size("memorysize", "Overall memory size, ", "MEMORY SIZE", false, "10m"),
|
||||||
_max_chunk_size("maxchunksize", "Size of an individual disk chunk", "JLONG", false, "12582912"),
|
_max_chunk_size("maxchunksize", "Size of an individual disk chunk", "MEMORY SIZE", false, "12m"),
|
||||||
_sample_threads("samplethreads", "Activate Thread sampling", "BOOLEAN", false, "true") {
|
_sample_threads("samplethreads", "Activate Thread sampling", "BOOLEAN", false, "true") {
|
||||||
_dcmdparser.add_dcmd_option(&_repository_path);
|
_dcmdparser.add_dcmd_option(&_repository_path);
|
||||||
_dcmdparser.add_dcmd_option(&_dump_path);
|
_dcmdparser.add_dcmd_option(&_dump_path);
|
||||||
@ -612,22 +612,22 @@ void JfrConfigureFlightRecorderDCmd::execute(DCmdSource source, TRAPS) {
|
|||||||
|
|
||||||
jobject global_buffer_size = NULL;
|
jobject global_buffer_size = NULL;
|
||||||
if (_global_buffer_size.is_set()) {
|
if (_global_buffer_size.is_set()) {
|
||||||
global_buffer_size = JfrJavaSupport::new_java_lang_Long(_global_buffer_size.value(), CHECK);
|
global_buffer_size = JfrJavaSupport::new_java_lang_Long(_global_buffer_size.value()._size, CHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
jobject thread_buffer_size = NULL;
|
jobject thread_buffer_size = NULL;
|
||||||
if (_thread_buffer_size.is_set()) {
|
if (_thread_buffer_size.is_set()) {
|
||||||
thread_buffer_size = JfrJavaSupport::new_java_lang_Long(_thread_buffer_size.value(), CHECK);
|
thread_buffer_size = JfrJavaSupport::new_java_lang_Long(_thread_buffer_size.value()._size, CHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
jobject max_chunk_size = NULL;
|
jobject max_chunk_size = NULL;
|
||||||
if (_max_chunk_size.is_set()) {
|
if (_max_chunk_size.is_set()) {
|
||||||
max_chunk_size = JfrJavaSupport::new_java_lang_Long(_max_chunk_size.value(), CHECK);
|
max_chunk_size = JfrJavaSupport::new_java_lang_Long(_max_chunk_size.value()._size, CHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
jobject memory_size = NULL;
|
jobject memory_size = NULL;
|
||||||
if (_memory_size.is_set()) {
|
if (_memory_size.is_set()) {
|
||||||
memory_size = JfrJavaSupport::new_java_lang_Long(_memory_size.value(), CHECK);
|
memory_size = JfrJavaSupport::new_java_lang_Long(_memory_size.value()._size, CHECK);
|
||||||
}
|
}
|
||||||
|
|
||||||
jobject sample_threads = NULL;
|
jobject sample_threads = NULL;
|
||||||
|
@ -145,10 +145,10 @@ class JfrConfigureFlightRecorderDCmd : public DCmdWithParser {
|
|||||||
DCmdArgument<char*> _dump_path;
|
DCmdArgument<char*> _dump_path;
|
||||||
DCmdArgument<jlong> _stack_depth;
|
DCmdArgument<jlong> _stack_depth;
|
||||||
DCmdArgument<jlong> _global_buffer_count;
|
DCmdArgument<jlong> _global_buffer_count;
|
||||||
DCmdArgument<jlong> _global_buffer_size;
|
DCmdArgument<MemorySizeArgument> _global_buffer_size;
|
||||||
DCmdArgument<jlong> _thread_buffer_size;
|
DCmdArgument<MemorySizeArgument> _thread_buffer_size;
|
||||||
DCmdArgument<jlong> _memory_size;
|
DCmdArgument<MemorySizeArgument> _memory_size;
|
||||||
DCmdArgument<jlong> _max_chunk_size;
|
DCmdArgument<MemorySizeArgument> _max_chunk_size;
|
||||||
DCmdArgument<bool> _sample_threads;
|
DCmdArgument<bool> _sample_threads;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -352,19 +352,19 @@ bool JfrOptionSet::configure(TRAPS) {
|
|||||||
configure._stack_depth.set_value(_dcmd_stackdepth.value());
|
configure._stack_depth.set_value(_dcmd_stackdepth.value());
|
||||||
|
|
||||||
configure._thread_buffer_size.set_is_set(_dcmd_threadbuffersize.is_set());
|
configure._thread_buffer_size.set_is_set(_dcmd_threadbuffersize.is_set());
|
||||||
configure._thread_buffer_size.set_value(_dcmd_threadbuffersize.value()._size);
|
configure._thread_buffer_size.set_value(_dcmd_threadbuffersize.value());
|
||||||
|
|
||||||
configure._global_buffer_count.set_is_set(_dcmd_numglobalbuffers.is_set());
|
configure._global_buffer_count.set_is_set(_dcmd_numglobalbuffers.is_set());
|
||||||
configure._global_buffer_count.set_value(_dcmd_numglobalbuffers.value());
|
configure._global_buffer_count.set_value(_dcmd_numglobalbuffers.value());
|
||||||
|
|
||||||
configure._global_buffer_size.set_is_set(_dcmd_globalbuffersize.is_set());
|
configure._global_buffer_size.set_is_set(_dcmd_globalbuffersize.is_set());
|
||||||
configure._global_buffer_size.set_value(_dcmd_globalbuffersize.value()._size);
|
configure._global_buffer_size.set_value(_dcmd_globalbuffersize.value());
|
||||||
|
|
||||||
configure._max_chunk_size.set_is_set(_dcmd_maxchunksize.is_set());
|
configure._max_chunk_size.set_is_set(_dcmd_maxchunksize.is_set());
|
||||||
configure._max_chunk_size.set_value(_dcmd_maxchunksize.value()._size);
|
configure._max_chunk_size.set_value(_dcmd_maxchunksize.value());
|
||||||
|
|
||||||
configure._memory_size.set_is_set(_dcmd_memorysize.is_set());
|
configure._memory_size.set_is_set(_dcmd_memorysize.is_set());
|
||||||
configure._memory_size.set_value(_dcmd_memorysize.value()._size);
|
configure._memory_size.set_value(_dcmd_memorysize.value());
|
||||||
|
|
||||||
configure._sample_threads.set_is_set(_dcmd_sample_threads.is_set());
|
configure._sample_threads.set_is_set(_dcmd_sample_threads.is_set());
|
||||||
configure._sample_threads.set_value(_dcmd_sample_threads.value());
|
configure._sample_threads.set_value(_dcmd_sample_threads.value());
|
||||||
|
@ -99,9 +99,7 @@ public class TestJcmdConfigure {
|
|||||||
|
|
||||||
private static void testNegative(String configName, Object value) {
|
private static void testNegative(String configName, Object value) {
|
||||||
try {
|
try {
|
||||||
// Syntactically invalid arguments are catched by the JCMD framework where an error code of 1 is returned.
|
JcmdHelper.jcmd(1, "JFR.configure", configName + "=" + value);
|
||||||
// Syntactically valid arguments that are semantically invalid (invalid value ranges for example) are handled by JFR code, it will always return a value of 0.
|
|
||||||
JcmdHelper.jcmd(configName.equals(UNSUPPORTED_OPTION) ? 1 : 0, "JFR.configure", configName + "=" + value);
|
|
||||||
} catch(Exception e) {
|
} catch(Exception e) {
|
||||||
testExceptions.add(e);
|
testExceptions.add(e);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user