src/hotspot/share/prims/jvmti.xml
changeset 50578 e2a7f431f65c
parent 50530 7e3aa681a484
child 50735 2f2af62dfac7
equal deleted inserted replaced
50577:bf7e2684cd0a 50578:e2a7f431f65c
 10351           are enabled then the <eventlink id="ClassFileLoadHook"/> events
 10351           are enabled then the <eventlink id="ClassFileLoadHook"/> events
 10352           can be posted for classes loaded in the primordial phase.
 10352           can be posted for classes loaded in the primordial phase.
 10353           See <eventlink id="ClassFileLoadHook"/>.
 10353           See <eventlink id="ClassFileLoadHook"/>.
 10354         </description>
 10354         </description>
 10355       </capabilityfield>
 10355       </capabilityfield>
       
 10356       <capabilityfield id="can_generate_sampled_object_alloc_events" since="11">
       
 10357         <description>
       
 10358           Can generate sampled allocation events.
       
 10359           If this capability is enabled then the heap sampling method
       
 10360 	  <functionlink id="SetHeapSamplingRate"></functionlink> can be
       
 10361 	  called and <eventlink id="SampledObjectAlloc"></eventlink> events can be generated.
       
 10362         </description>
       
 10363       </capabilityfield>
 10356     </capabilitiestypedef>
 10364     </capabilitiestypedef>
 10357 
 10365 
 10358     <function id="GetPotentialCapabilities" jkernel="yes" phase="onload" num="140">
 10366     <function id="GetPotentialCapabilities" jkernel="yes" phase="onload" num="140">
 10359       <synopsis>Get Potential Capabilities</synopsis>
 10367       <synopsis>Get Potential Capabilities</synopsis>
 10360       <description>
 10368       <description>
 11527       </parameters>
 11535       </parameters>
 11528       <errors>
 11536       <errors>
 11529       </errors>
 11537       </errors>
 11530     </function>
 11538     </function>
 11531 
 11539 
       
 11540   </category>
       
 11541 
       
 11542   <category id="heap_monitoring" label="Heap Monitoring">
       
 11543     <function id="SetHeapSamplingRate" phase="onload" num="156" since="11">
       
 11544       <synopsis>Set Heap Sampling Rate</synopsis>
       
 11545       <description>
       
 11546         Generate a <eventlink id="SampledObjectAlloc"/> event when objects are allocated.
       
 11547 	Each thread keeps a counter of bytes allocated. The event will only be generated
       
 11548 	when that counter exceeds an average of <paramlink id="sampling_rate"></paramlink>
       
 11549 	since the last sample.
       
 11550         <p/>
       
 11551         Setting <paramlink id="sampling_rate"></paramlink> to 0 will cause an event to be
       
 11552 	generated by each allocation supported by the system.
       
 11553       </description>
       
 11554       <origin>new</origin>
       
 11555       <capabilities>
       
 11556         <required id="can_generate_sampled_object_alloc_events"></required>
       
 11557       </capabilities>
       
 11558       <parameters>
       
 11559         <param id="sampling_rate">
       
 11560           <jint/>
       
 11561           <description>
       
 11562             The sampling rate in bytes. The sampler uses a statistical approach to
       
 11563             generate an event, on average, once for every <paramlink id="sampling_rate"/> bytes of
       
 11564 	    memory allocated by a given thread.
       
 11565             <p/>
       
 11566             Passing 0 as a sampling rate generates a sample for every allocation.
       
 11567             <p/>
       
 11568             Note: The overhead of this feature is directly correlated with the sampling rate. 
       
 11569 	    A high sampling rate, such as 1024 bytes, will incur a high overhead.
       
 11570 	    A lower rate, such as 1024KB, will have a much lower overhead.  Sampling should only
       
 11571 	    be used with an understanding that it may impact performance.
       
 11572           </description>
       
 11573         </param>
       
 11574       </parameters>
       
 11575       <errors>
       
 11576         <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT">
       
 11577           <paramlink id="sampling_rate"></paramlink> is less than zero.
       
 11578         </error>
       
 11579       </errors>
       
 11580     </function>
 11532   </category>
 11581   </category>
 11533 
 11582 
 11534 </functionsection>
 11583 </functionsection>
 11535 
 11584 
 11536 <errorsection label="Error Reference">
 11585 <errorsection label="Error Reference">
 13493 	  </description>
 13542 	  </description>
 13494       </param>
 13543       </param>
 13495       <param id="object">
 13544       <param id="object">
 13496 	<jobject/>
 13545 	<jobject/>
 13497 	  <description>
 13546 	  <description>
 13498 	    JNI local reference to the object that was allocated
 13547 	    JNI local reference to the object that was allocated.
 13499 	  </description>
 13548 	  </description>
 13500       </param>
 13549       </param>
 13501       <param id="object_klass">
 13550       <param id="object_klass">
 13502 	<jclass/>
 13551 	<jclass/>
 13503 	  <description>
 13552 	  <description>
 13504 	    JNI local reference to the class of the object
 13553 	    JNI local reference to the class of the object.
 13505 	  </description>
 13554 	  </description>
 13506       </param>
 13555       </param>
 13507       <param id="size">
 13556       <param id="size">
 13508 	<jlong/>
 13557 	<jlong/>
 13509 	<description>
 13558 	<description>
 13511 	</description>
 13560 	</description>
 13512       </param>
 13561       </param>
 13513     </parameters>
 13562     </parameters>
 13514   </event>
 13563   </event>
 13515 
 13564 
       
 13565   <event label="Sampled Object Allocation"
       
 13566     id="SampledObjectAlloc" const="JVMTI_EVENT_SAMPLED_OBJECT_ALLOC" num="86" since="11">
       
 13567     <description>
       
 13568       Sent when an allocated object is sampled.
       
 13569       By default, the sampling rate is a geometric variable with a 512KB mean.  
       
 13570       Each thread tracks how many bytes it has allocated since it sent the last event.
       
 13571       When the number of bytes exceeds the sampling rate, it will send another event.
       
 13572       This implies that, on average, one object will be sampled every time a thread has
       
 13573       allocated 512KB bytes since the last sample.
       
 13574       <p/>
       
 13575       Note that this is a geometric variable: it will not sample every 512KB precisely.
       
 13576       The goal of this is to ensure high quality sampling even if allocation is
       
 13577       happening in a fixed pattern (i.e., the same set of objects are being allocated
       
 13578       every 512KB).
       
 13579       <p/>
       
 13580       If another sampling rate is required, the user can call
       
 13581       <functionlink id="SetHeapSamplingRate"></functionlink> with a strictly positive integer value, representing
       
 13582       the new sampling rate.
       
 13583       <p/>
       
 13584       This event is sent once the sampled allocation has been performed.  It provides the object, stack trace
       
 13585       of the allocation, the thread allocating, the size of allocation, and the object's class.
       
 13586       <p/>
       
 13587       A typical use case of this system is to determine where heap allocations originate.
       
 13588       In conjunction with weak references and the function
       
 13589       <functionlink id="GetStackTrace"></functionlink>, a user can track which objects were allocated from which
       
 13590       stack trace, and which are still live during the execution of the program.
       
 13591     </description>
       
 13592     <origin>new</origin>
       
 13593     <capabilities>
       
 13594       <required id="can_generate_sampled_object_alloc_events"></required>
       
 13595     </capabilities>
       
 13596     <parameters>
       
 13597       <param id="jni_env">
       
 13598         <outptr>
       
 13599           <struct>JNIEnv</struct>
       
 13600         </outptr>
       
 13601         <description>
       
 13602           The JNI environment of the event (current) thread.
       
 13603         </description>
       
 13604       </param>
       
 13605       <param id="thread">
       
 13606         <jthread/>
       
 13607         <description>
       
 13608           Thread allocating the object.
       
 13609         </description>
       
 13610       </param>
       
 13611       <param id="object">
       
 13612         <jobject/>
       
 13613         <description>
       
 13614           JNI local reference to the object that was allocated.
       
 13615         </description>
       
 13616       </param>
       
 13617       <param id="object_klass">
       
 13618         <jclass/>
       
 13619         <description>
       
 13620           JNI local reference to the class of the object
       
 13621         </description>
       
 13622       </param>
       
 13623       <param id="size">
       
 13624         <jlong/>
       
 13625         <description>
       
 13626           Size of the object (in bytes). See <functionlink id="GetObjectSize"/>.
       
 13627         </description>
       
 13628       </param>
       
 13629     </parameters>
       
 13630   </event>
       
 13631 
 13516   <event label="Object Free"
 13632   <event label="Object Free"
 13517 	 id="ObjectFree" const="JVMTI_EVENT_OBJECT_FREE" num="83">
 13633         id="ObjectFree" const="JVMTI_EVENT_OBJECT_FREE" num="83">
 13518     <description>
 13634     <description>
 13519       An Object Free event is sent when the garbage collector frees an object.
 13635       An Object Free event is sent when the garbage collector frees an object.
 13520       Events are only sent for tagged objects--see
 13636       Events are only sent for tagged objects--see
 13521       <internallink id="Heap">heap functions</internallink>.
 13637       <internallink id="Heap">heap functions</internallink>.
 13522       <p/>
 13638       <p/>
 13532     <parameters>
 13648     <parameters>
 13533       <param id="tag">
 13649       <param id="tag">
 13534 	<jlong/>
 13650 	<jlong/>
 13535 	<description>
 13651 	<description>
 13536 	  The freed object's tag
 13652 	  The freed object's tag
 13537 	</description>
 13653 	</description>        
 13538       </param>
 13654       </param>
 13539     </parameters>
 13655     </parameters>
 13540   </event>
 13656   </event>
 13541 
 13657 
 13542   <event label="Garbage Collection Start"
 13658   <event label="Garbage Collection Start"