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

make JVMTI thread cpu time functions optional for virtual threads

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • None
    • 21
    • hotspot
    • None
    • b11

    Description

      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>

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: