src/hotspot/share/jfr/dcmd/jfrDcmds.cpp
branchJEP-349-branch
changeset 57860 588a3f63efff
parent 57360 5d043a159d5c
child 57870 00860d9caf4d
equal deleted inserted replaced
57859:f4230f4bdd6b 57860:588a3f63efff
   347   _duration("duration", "Duration of recording in (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 300s.", "NANOTIME", false, "0"),
   347   _duration("duration", "Duration of recording in (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 300s.", "NANOTIME", false, "0"),
   348   _disk("disk", "Recording should be persisted to disk", "BOOLEAN", false),
   348   _disk("disk", "Recording should be persisted to disk", "BOOLEAN", false),
   349   _filename("filename", "Resulting recording filename, e.g. \\\"" JFR_FILENAME_EXAMPLE "\\\"", "STRING", false),
   349   _filename("filename", "Resulting recording filename, e.g. \\\"" JFR_FILENAME_EXAMPLE "\\\"", "STRING", false),
   350   _maxage("maxage", "Maximum time to keep recorded data (on disk) in (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 60m, or 0 for no limit", "NANOTIME", false, "0"),
   350   _maxage("maxage", "Maximum time to keep recorded data (on disk) in (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 60m, or 0 for no limit", "NANOTIME", false, "0"),
   351   _maxsize("maxsize", "Maximum amount of bytes to keep (on disk) in (k)B, (M)B or (G)B, e.g. 500M, or 0 for no limit", "MEMORY SIZE", false, "0"),
   351   _maxsize("maxsize", "Maximum amount of bytes to keep (on disk) in (k)B, (M)B or (G)B, e.g. 500M, or 0 for no limit", "MEMORY SIZE", false, "0"),
   352   _flush("flush", "Maximum time before flushing buffers, measuare in (s)econds, e.g. 4 s, or 0 for flushing when a recording ends", "NANOTIME", false, "0"),
   352   _flush_interval("flush-interval", "Minimum time before flushing buffers, measuared in (s)econds, e.g. 4 s, or 0 for flushing when a recording ends", "NANOTIME", false, "0"),
   353   _dump_on_exit("dumponexit", "Dump running recording when JVM shuts down", "BOOLEAN", false),
   353   _dump_on_exit("dumponexit", "Dump running recording when JVM shuts down", "BOOLEAN", false),
   354   _path_to_gc_roots("path-to-gc-roots", "Collect path to GC roots", "BOOLEAN", false, "false") {
   354   _path_to_gc_roots("path-to-gc-roots", "Collect path to GC roots", "BOOLEAN", false, "false") {
   355   _dcmdparser.add_dcmd_option(&_name);
   355   _dcmdparser.add_dcmd_option(&_name);
   356   _dcmdparser.add_dcmd_option(&_settings);
   356   _dcmdparser.add_dcmd_option(&_settings);
   357   _dcmdparser.add_dcmd_option(&_delay);
   357   _dcmdparser.add_dcmd_option(&_delay);
   358   _dcmdparser.add_dcmd_option(&_duration);
   358   _dcmdparser.add_dcmd_option(&_duration);
   359   _dcmdparser.add_dcmd_option(&_disk);
   359   _dcmdparser.add_dcmd_option(&_disk);
   360   _dcmdparser.add_dcmd_option(&_filename);
   360   _dcmdparser.add_dcmd_option(&_filename);
   361   _dcmdparser.add_dcmd_option(&_maxage);
   361   _dcmdparser.add_dcmd_option(&_maxage);
   362   _dcmdparser.add_dcmd_option(&_maxsize);
   362   _dcmdparser.add_dcmd_option(&_maxsize);
   363   _dcmdparser.add_dcmd_option(&_flush);
   363   _dcmdparser.add_dcmd_option(&_flush_interval);
   364   _dcmdparser.add_dcmd_option(&_dump_on_exit);
   364   _dcmdparser.add_dcmd_option(&_dump_on_exit);
   365   _dcmdparser.add_dcmd_option(&_path_to_gc_roots);
   365   _dcmdparser.add_dcmd_option(&_path_to_gc_roots);
   366 };
   366 };
   367 
   367 
   368 int JfrStartFlightRecordingDCmd::num_arguments() {
   368 int JfrStartFlightRecordingDCmd::num_arguments() {
   411   jobject maxsize = NULL;
   411   jobject maxsize = NULL;
   412   if (_maxsize.is_set()) {
   412   if (_maxsize.is_set()) {
   413     maxsize = JfrJavaSupport::new_java_lang_Long(_maxsize.value()._size, CHECK);
   413     maxsize = JfrJavaSupport::new_java_lang_Long(_maxsize.value()._size, CHECK);
   414   }
   414   }
   415 
   415 
   416   jobject flush = NULL;
   416   jobject flush_interval = NULL;
   417   if (_flush.is_set()) {
   417   if (_flush_interval.is_set()) {
   418     flush = JfrJavaSupport::new_java_lang_Long(_flush.value()._nanotime, CHECK);
   418     flush_interval = JfrJavaSupport::new_java_lang_Long(_flush_interval.value()._nanotime, CHECK);
   419   }
   419   }
   420   jobject duration = NULL;
   420   jobject duration = NULL;
   421   if (_duration.is_set()) {
   421   if (_duration.is_set()) {
   422     duration = JfrJavaSupport::new_java_lang_Long(_duration.value()._nanotime, CHECK);
   422     duration = JfrJavaSupport::new_java_lang_Long(_duration.value()._nanotime, CHECK);
   423   }
   423   }
   476   execute_args.push_jobject(duration);
   476   execute_args.push_jobject(duration);
   477   execute_args.push_jobject(disk);
   477   execute_args.push_jobject(disk);
   478   execute_args.push_jobject(filename);
   478   execute_args.push_jobject(filename);
   479   execute_args.push_jobject(maxage);
   479   execute_args.push_jobject(maxage);
   480   execute_args.push_jobject(maxsize);
   480   execute_args.push_jobject(maxsize);
   481   execute_args.push_jobject(flush);
   481   execute_args.push_jobject(flush_interval);
   482   execute_args.push_jobject(dump_on_exit);
   482   execute_args.push_jobject(dump_on_exit);
   483   execute_args.push_jobject(path_to_gc_roots);
   483   execute_args.push_jobject(path_to_gc_roots);
   484 
   484 
   485   JfrJavaSupport::call_virtual(&execute_args, THREAD);
   485   JfrJavaSupport::call_virtual(&execute_args, THREAD);
   486   handle_dcmd_result(output(), (oop)result.get_jobject(), source, THREAD);
   486   handle_dcmd_result(output(), (oop)result.get_jobject(), source, THREAD);