src/hotspot/share/jfr/recorder/service/jfrRecorderThreadLoop.cpp
changeset 58863 c16ac7a2eba4
parent 54623 1126f0607c70
equal deleted inserted replaced
58861:2c3cc4b01880 58863:c16ac7a2eba4
    38 void recorderthread_entry(JavaThread* thread, Thread* unused) {
    38 void recorderthread_entry(JavaThread* thread, Thread* unused) {
    39   assert(thread != NULL, "invariant");
    39   assert(thread != NULL, "invariant");
    40   #define START (msgs & (MSGBIT(MSG_START)))
    40   #define START (msgs & (MSGBIT(MSG_START)))
    41   #define SHUTDOWN (msgs & MSGBIT(MSG_SHUTDOWN))
    41   #define SHUTDOWN (msgs & MSGBIT(MSG_SHUTDOWN))
    42   #define ROTATE (msgs & (MSGBIT(MSG_ROTATE)|MSGBIT(MSG_STOP)))
    42   #define ROTATE (msgs & (MSGBIT(MSG_ROTATE)|MSGBIT(MSG_STOP)))
       
    43   #define FLUSHPOINT (msgs & (MSGBIT(MSG_FLUSHPOINT)))
    43   #define PROCESS_FULL_BUFFERS (msgs & (MSGBIT(MSG_ROTATE)|MSGBIT(MSG_STOP)|MSGBIT(MSG_FULLBUFFER)))
    44   #define PROCESS_FULL_BUFFERS (msgs & (MSGBIT(MSG_ROTATE)|MSGBIT(MSG_STOP)|MSGBIT(MSG_FULLBUFFER)))
    44   #define SCAVENGE (msgs & (MSGBIT(MSG_DEADBUFFER)))
    45   #define SCAVENGE (msgs & (MSGBIT(MSG_DEADBUFFER)))
    45 
    46 
    46   JfrPostBox& post_box = JfrRecorderThread::post_box();
    47   JfrPostBox& post_box = JfrRecorderThread::post_box();
    47   log_debug(jfr, system)("Recorder thread STARTED");
    48   log_debug(jfr, system)("Recorder thread STARTED");
    70       service.evaluate_chunk_size_for_rotation();
    71       service.evaluate_chunk_size_for_rotation();
    71       if (START) {
    72       if (START) {
    72         service.start();
    73         service.start();
    73       } else if (ROTATE) {
    74       } else if (ROTATE) {
    74         service.rotate(msgs);
    75         service.rotate(msgs);
       
    76       } else if (FLUSHPOINT) {
       
    77         service.flushpoint();
    75       }
    78       }
    76       JfrMsg_lock->lock();
    79       JfrMsg_lock->lock();
    77       post_box.notify_waiters();
    80       post_box.notify_waiters();
    78       if (SHUTDOWN) {
    81       if (SHUTDOWN) {
    79         log_debug(jfr, system)("Request to STOP recorder");
    82         log_debug(jfr, system)("Request to STOP recorder");
    88   JfrRecorder::on_recorder_thread_exit();
    91   JfrRecorder::on_recorder_thread_exit();
    89 
    92 
    90   #undef START
    93   #undef START
    91   #undef SHUTDOWN
    94   #undef SHUTDOWN
    92   #undef ROTATE
    95   #undef ROTATE
       
    96   #undef FLUSHPOINT
    93   #undef PROCESS_FULL_BUFFERS
    97   #undef PROCESS_FULL_BUFFERS
    94   #undef SCAVENGE
    98   #undef SCAVENGE
    95 }
    99 }