< prev index next >

src/hotspot/share/jfr/support/jfrThreadLocal.hpp

Print this page
@@ -39,30 +39,35 @@
    mutable JfrBuffer* _java_buffer;
    mutable JfrBuffer* _native_buffer;
    JfrBuffer* _shelved_buffer;
    JfrBuffer* _load_barrier_buffer_epoch_0;
    JfrBuffer* _load_barrier_buffer_epoch_1;
+   JfrBuffer* _checkpoint_buffer_epoch_0;
+   JfrBuffer* _checkpoint_buffer_epoch_1;
    mutable JfrStackFrame* _stackframes;
-   mutable traceid _trace_id;
    JfrBlobHandle _thread;
+   mutable traceid _thread_id;
+   mutable traceid _thread_id_alias;
    u8 _data_lost;
    traceid _stack_trace_id;
    jlong _user_time;
    jlong _cpu_time;
    jlong _wallclock_time;
    unsigned int _stack_trace_hash;
    mutable u4 _stackdepth;
    volatile jint _entering_suspend_flag;
+   mutable volatile int _critical_section;
    bool _excluded;
    bool _dead;
    traceid _parent_trace_id;
  
    JfrBuffer* install_native_buffer() const;
    JfrBuffer* install_java_buffer() const;
    JfrStackFrame* install_stackframes() const;
    void release(Thread* t);
    static void release(JfrThreadLocal* tl, Thread* t);
+   static traceid assign_thread_id(const Thread* t);
  
   public:
    JfrThreadLocal();
  
    JfrBuffer* native_buffer() const {

@@ -121,17 +126,19 @@
  
    void set_stackdepth(u4 depth) {
      _stackdepth = depth;
    }
  
-   traceid thread_id() const {
-     return _trace_id;
-   }
+   // jfr contextual thread id
+   static traceid thread_id(const Thread* t, bool* is_virtual = NULL);
+   static traceid virtual_thread_id(const Thread* t, oop vthread);
+   // jfr hardware thread id
+   static traceid vm_thread_id(const Thread* t);
  
-   void set_thread_id(traceid thread_id) {
-     _trace_id = thread_id;
-   }
+   static void impersonate(const Thread* t, traceid other_thread_id);
+   static void stop_impersonating(const Thread* t);
+   static bool is_impersonating(const Thread* t);
  
    traceid parent_thread_id() const {
      return _parent_trace_id;
    }
  

@@ -198,19 +205,19 @@
    void set_wallclock_time(jlong wallclock_time) {
      _wallclock_time = wallclock_time;
    }
  
    traceid trace_id() const {
-     return _trace_id;
+     return _thread_id;
    }
  
    traceid* const trace_id_addr() const {
-     return &_trace_id;
+     return &_thread_id;
    }
  
    void set_trace_id(traceid id) const {
-     _trace_id = id;
+     _thread_id = id;
    }
  
    bool is_excluded() const {
      return _excluded;
    }

@@ -225,16 +232,20 @@
  
    static void exclude(Thread* t);
    static void include(Thread* t);
  
    static void on_start(Thread* t);
+   static void on_vthread_start(JavaThread* jt, jobject vthread);
    static void on_exit(Thread* t);
+   static void on_vthread_exit(JavaThread* jt, jobject vthread);
  
    // Code generation
    static ByteSize trace_id_offset();
    static ByteSize java_event_writer_offset();
  
+   friend class JfrJavaThread;
+   friend class JfrCheckpointManager;
    template <typename>
    friend class JfrEpochQueueKlassPolicy;
  };
  
  #endif // SHARE_JFR_SUPPORT_JFRTHREADLOCAL_HPP
< prev index next >