521 522 static const char klass[] = "jdk/jfr/internal/dcmd/DCmdStop"; 523 static const char method[] = "execute"; 524 static const char signature[] = "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"; 525 526 JfrJavaArguments execute_args(&result, klass, method, signature, CHECK); 527 execute_args.set_receiver(h_dcmd_instance); 528 529 // arguments 530 execute_args.push_jobject(name); 531 execute_args.push_jobject(filepath); 532 533 JfrJavaSupport::call_virtual(&execute_args, THREAD); 534 handle_dcmd_result(output(), (oop)result.get_jobject(), source, THREAD); 535 } 536 537 JfrConfigureFlightRecorderDCmd::JfrConfigureFlightRecorderDCmd(outputStream* output, 538 bool heap) : DCmdWithParser(output, heap), 539 _repository_path("repositorypath", "Path to repository,.e.g \\\"My Repository\\\"", "STRING", false, NULL), 540 _dump_path("dumppath", "Path to dump,.e.g \\\"My Dump path\\\"", "STRING", false, NULL), 541 _stack_depth("stackdepth", "Stack Depth", "JLONG", false, "64"), 542 _global_buffer_count("globalbuffercount", "Number of global buffers,", "JLONG", false, "32"), 543 _global_buffer_size("globalbuffersize", "Size of a global buffers,", "JLONG", false, "524288"), 544 _thread_buffer_size("thread_buffer_size", "Size of a thread buffer", "JLONG", false, "8192"), 545 _memory_size("memorysize", "Overall memory size, ", "JLONG", false, "16777216"), 546 _max_chunk_size("maxchunksize", "Size of an individual disk chunk", "JLONG", false, "12582912"), 547 _sample_threads("samplethreads", "Activate Thread sampling", "BOOLEAN", false, "true") { 548 _dcmdparser.add_dcmd_option(&_repository_path); 549 _dcmdparser.add_dcmd_option(&_dump_path); 550 _dcmdparser.add_dcmd_option(&_stack_depth); 551 _dcmdparser.add_dcmd_option(&_global_buffer_count); 552 _dcmdparser.add_dcmd_option(&_global_buffer_size); 553 _dcmdparser.add_dcmd_option(&_thread_buffer_size); 554 _dcmdparser.add_dcmd_option(&_memory_size); 555 _dcmdparser.add_dcmd_option(&_max_chunk_size); 556 _dcmdparser.add_dcmd_option(&_sample_threads); 557 }; 558 559 int JfrConfigureFlightRecorderDCmd::num_arguments() { 560 ResourceMark rm; 561 JfrConfigureFlightRecorderDCmd* dcmd = new JfrConfigureFlightRecorderDCmd(NULL, false); 562 if (dcmd != NULL) { 563 DCmdMark mark(dcmd); 564 return dcmd->_dcmdparser.num_arguments(); 565 } 566 return 0; 589 repository_path = JfrJavaSupport::new_string(_repository_path.value(), CHECK); 590 } 591 592 jstring dump_path = NULL; 593 if (_dump_path.is_set() && _dump_path.value() != NULL) { 594 dump_path = JfrJavaSupport::new_string(_dump_path.value(), CHECK); 595 } 596 597 jobject stack_depth = NULL; 598 if (_stack_depth.is_set()) { 599 stack_depth = JfrJavaSupport::new_java_lang_Integer((jint)_stack_depth.value(), CHECK); 600 } 601 602 jobject global_buffer_count = NULL; 603 if (_global_buffer_count.is_set()) { 604 global_buffer_count = JfrJavaSupport::new_java_lang_Long(_global_buffer_count.value(), CHECK); 605 } 606 607 jobject global_buffer_size = NULL; 608 if (_global_buffer_size.is_set()) { 609 global_buffer_size = JfrJavaSupport::new_java_lang_Long(_global_buffer_size.value(), CHECK); 610 } 611 612 jobject thread_buffer_size = NULL; 613 if (_thread_buffer_size.is_set()) { 614 thread_buffer_size = JfrJavaSupport::new_java_lang_Long(_thread_buffer_size.value(), CHECK); 615 } 616 617 jobject max_chunk_size = NULL; 618 if (_max_chunk_size.is_set()) { 619 max_chunk_size = JfrJavaSupport::new_java_lang_Long(_max_chunk_size.value(), CHECK); 620 } 621 622 jobject memory_size = NULL; 623 if (_memory_size.is_set()) { 624 memory_size = JfrJavaSupport::new_java_lang_Long(_memory_size.value(), CHECK); 625 } 626 627 jobject sample_threads = NULL; 628 if (_sample_threads.is_set()) { 629 sample_threads = JfrJavaSupport::new_java_lang_Boolean(_sample_threads.value(), CHECK); 630 } 631 632 static const char klass[] = "jdk/jfr/internal/dcmd/DCmdConfigure"; 633 static const char method[] = "execute"; 634 static const char signature[] = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;" 635 "Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;" 636 "Ljava/lang/Long;Ljava/lang/Boolean;)Ljava/lang/String;"; 637 638 JfrJavaArguments execute_args(&result, klass, method, signature, CHECK); 639 execute_args.set_receiver(h_dcmd_instance); 640 641 // params 642 execute_args.push_jobject(repository_path); 643 execute_args.push_jobject(dump_path); 644 execute_args.push_jobject(stack_depth); | 521 522 static const char klass[] = "jdk/jfr/internal/dcmd/DCmdStop"; 523 static const char method[] = "execute"; 524 static const char signature[] = "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"; 525 526 JfrJavaArguments execute_args(&result, klass, method, signature, CHECK); 527 execute_args.set_receiver(h_dcmd_instance); 528 529 // arguments 530 execute_args.push_jobject(name); 531 execute_args.push_jobject(filepath); 532 533 JfrJavaSupport::call_virtual(&execute_args, THREAD); 534 handle_dcmd_result(output(), (oop)result.get_jobject(), source, THREAD); 535 } 536 537 JfrConfigureFlightRecorderDCmd::JfrConfigureFlightRecorderDCmd(outputStream* output, 538 bool heap) : DCmdWithParser(output, heap), 539 _repository_path("repositorypath", "Path to repository,.e.g \\\"My Repository\\\"", "STRING", false, NULL), 540 _dump_path("dumppath", "Path to dump,.e.g \\\"My Dump path\\\"", "STRING", false, NULL), 541 _stack_depth("stackdepth", "Stack Depth", "JULONG", false, "64"), 542 _global_buffer_count("globalbuffercount", "Number of global buffers,", "JULONG", false, "20"), 543 _global_buffer_size("globalbuffersize", "Size of a global buffers,", "MEMORY SIZE", false, "512k"), 544 _thread_buffer_size("thread_buffer_size", "Size of a thread buffer", "MEMORY SIZE", false, "8k"), 545 _memory_size("memorysize", "Overall memory size, ", "MEMORY SIZE", false, "10m"), 546 _max_chunk_size("maxchunksize", "Size of an individual disk chunk", "MEMORY SIZE", false, "12m"), 547 _sample_threads("samplethreads", "Activate Thread sampling", "BOOLEAN", false, "true") { 548 _dcmdparser.add_dcmd_option(&_repository_path); 549 _dcmdparser.add_dcmd_option(&_dump_path); 550 _dcmdparser.add_dcmd_option(&_stack_depth); 551 _dcmdparser.add_dcmd_option(&_global_buffer_count); 552 _dcmdparser.add_dcmd_option(&_global_buffer_size); 553 _dcmdparser.add_dcmd_option(&_thread_buffer_size); 554 _dcmdparser.add_dcmd_option(&_memory_size); 555 _dcmdparser.add_dcmd_option(&_max_chunk_size); 556 _dcmdparser.add_dcmd_option(&_sample_threads); 557 }; 558 559 int JfrConfigureFlightRecorderDCmd::num_arguments() { 560 ResourceMark rm; 561 JfrConfigureFlightRecorderDCmd* dcmd = new JfrConfigureFlightRecorderDCmd(NULL, false); 562 if (dcmd != NULL) { 563 DCmdMark mark(dcmd); 564 return dcmd->_dcmdparser.num_arguments(); 565 } 566 return 0; 589 repository_path = JfrJavaSupport::new_string(_repository_path.value(), CHECK); 590 } 591 592 jstring dump_path = NULL; 593 if (_dump_path.is_set() && _dump_path.value() != NULL) { 594 dump_path = JfrJavaSupport::new_string(_dump_path.value(), CHECK); 595 } 596 597 jobject stack_depth = NULL; 598 if (_stack_depth.is_set()) { 599 stack_depth = JfrJavaSupport::new_java_lang_Integer((jint)_stack_depth.value(), CHECK); 600 } 601 602 jobject global_buffer_count = NULL; 603 if (_global_buffer_count.is_set()) { 604 global_buffer_count = JfrJavaSupport::new_java_lang_Long(_global_buffer_count.value(), CHECK); 605 } 606 607 jobject global_buffer_size = NULL; 608 if (_global_buffer_size.is_set()) { 609 global_buffer_size = JfrJavaSupport::new_java_lang_Long(_global_buffer_size.value()._size, CHECK); 610 } 611 612 jobject thread_buffer_size = NULL; 613 if (_thread_buffer_size.is_set()) { 614 thread_buffer_size = JfrJavaSupport::new_java_lang_Long(_thread_buffer_size.value()._size, CHECK); 615 } 616 617 jobject max_chunk_size = NULL; 618 if (_max_chunk_size.is_set()) { 619 max_chunk_size = JfrJavaSupport::new_java_lang_Long(_max_chunk_size.value()._size, CHECK); 620 } 621 622 jobject memory_size = NULL; 623 if (_memory_size.is_set()) { 624 memory_size = JfrJavaSupport::new_java_lang_Long(_memory_size.value()._size, CHECK); 625 } 626 627 jobject sample_threads = NULL; 628 if (_sample_threads.is_set()) { 629 sample_threads = JfrJavaSupport::new_java_lang_Boolean(_sample_threads.value(), CHECK); 630 } 631 632 static const char klass[] = "jdk/jfr/internal/dcmd/DCmdConfigure"; 633 static const char method[] = "execute"; 634 static const char signature[] = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;" 635 "Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/Long;" 636 "Ljava/lang/Long;Ljava/lang/Boolean;)Ljava/lang/String;"; 637 638 JfrJavaArguments execute_args(&result, klass, method, signature, CHECK); 639 execute_args.set_receiver(h_dcmd_instance); 640 641 // params 642 execute_args.push_jobject(repository_path); 643 execute_args.push_jobject(dump_path); 644 execute_args.push_jobject(stack_depth); |