Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8302615

make JVMTI thread cpu time functions optional for virtual threads

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • hotspot
    • b11

      Make support of two timer functions for virtual threads optional:
       - GetCurrentThreadCpuTime
       - GetThreadCpuTime

      To do that we can relax the spec as in patch below:

      diff --git a/src/hotspot/share/prims/jvmti.xml b/src/hotspot/share/prims/jvmti.xml
      index 4baaca503c0..5f68fc9a7a9 100644
      --- a/src/hotspot/share/prims/jvmti.xml
      +++ b/src/hotspot/share/prims/jvmti.xml
      @@ -11058,7 +11058,8 @@ myInit() {
             </parameters>
             <errors>
               <error id="JVMTI_ERROR_UNSUPPORTED_OPERATION">
      - Current thread is a virtual thread.
      + The current thread is a virtual thread and the implementation does not support
      + getting the current thread CPU time when the current thread is a virtual thread.
               </error>
             </errors>
           </function>
      @@ -11140,7 +11141,8 @@ myInit() {
             </parameters>
             <errors>
               <error id="JVMTI_ERROR_UNSUPPORTED_OPERATION">
      - <paramlink id="thread"/> is a virtual thread.
      + <paramlink id="thread"/> is a virtual thread and the implementation does not
      + support getting the thread CPU time of a virtual thread.
               </error>
             </errors>
           </function>

            sspitsyn Serguei Spitsyn
            sspitsyn Serguei Spitsyn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: