< prev index next >

src/hotspot/share/jfr/recorder/repository/jfrRepository.cpp

Print this page




  87     return;
  88   }
  89   JfrEmergencyDump::on_vm_error(_path);
  90 }
  91 
  92 bool JfrRepository::set_path(const char* path) {
  93   assert(path != NULL, "trying to set the repository path with a NULL string!");
  94   if (_path != NULL) {
  95     // delete existing
  96     JfrCHeapObj::free(_path, strlen(_path) + 1);
  97   }
  98   const size_t path_len = strlen(path);
  99   _path = JfrCHeapObj::new_array<char>(path_len + 1);
 100   if (_path == NULL) {
 101     return false;
 102   }
 103   strncpy(_path, path, path_len + 1);
 104   return true;
 105 }
 106 




 107 void JfrRepository::notify_on_new_chunk_path() {
 108   if (Jfr::is_recording()) {
 109     // rotations are synchronous, block until rotation completes
 110     instance()._post_box.post(MSG_ROTATE);
 111   }
 112 }
 113 
 114 void JfrRepository::set_chunk_path(const char* path) {
 115   chunkwriter().set_path(path);
 116 }
 117 
 118 void JfrRepository::mark_chunk_final() {
 119   chunkwriter().mark_chunk_final();
 120 }
 121 
 122 jlong JfrRepository::current_chunk_start_nanos() {
 123   return chunkwriter().current_chunk_start_nanos();
 124 }
 125 
 126 /**




  87     return;
  88   }
  89   JfrEmergencyDump::on_vm_error(_path);
  90 }
  91 
  92 bool JfrRepository::set_path(const char* path) {
  93   assert(path != NULL, "trying to set the repository path with a NULL string!");
  94   if (_path != NULL) {
  95     // delete existing
  96     JfrCHeapObj::free(_path, strlen(_path) + 1);
  97   }
  98   const size_t path_len = strlen(path);
  99   _path = JfrCHeapObj::new_array<char>(path_len + 1);
 100   if (_path == NULL) {
 101     return false;
 102   }
 103   strncpy(_path, path, path_len + 1);
 104   return true;
 105 }
 106 
 107 const char* JfrRepository::get_path() {
 108     return (_instance == NULL) ? NULL : _instance->_path;
 109 }
 110 
 111 void JfrRepository::notify_on_new_chunk_path() {
 112   if (Jfr::is_recording()) {
 113     // rotations are synchronous, block until rotation completes
 114     instance()._post_box.post(MSG_ROTATE);
 115   }
 116 }
 117 
 118 void JfrRepository::set_chunk_path(const char* path) {
 119   chunkwriter().set_path(path);
 120 }
 121 
 122 void JfrRepository::mark_chunk_final() {
 123   chunkwriter().mark_chunk_final();
 124 }
 125 
 126 jlong JfrRepository::current_chunk_start_nanos() {
 127   return chunkwriter().current_chunk_start_nanos();
 128 }
 129 
 130 /**


< prev index next >