RFR: 8316233: VirtualThreadStart events should not be thread-filtered [v3]

Alex Menkov amenkov at openjdk.org
Tue Oct 10 00:24:05 UTC 2023


On Tue, 10 Oct 2023 00:02:48 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> The JVMTI VirtualThreadStart events have to follow the ThreadStart events pattern and so, should not be thread-filtered.
>> The fix includes:
>>  - `jvmti.xml`: remov the attribute `filtered="thread"` in the `VirtuallThreadStart` event spec
>>  - `jvmtiEventController.cpp`: remove the `VTHREAD_START_BIT` from the `THREAD_FILTERED_EVENT_BITS` mask and and it to the `NEED_THREAD_LIFE_EVENTS` mask
>>  - `jvmtiExport.cpp`: rearrangements in the `JvmtiExport::post_vthread_start()` function
>> 
>> The fix also includes a couple of minor unification tweaks:
>>  - to align `JvmtiExport::post_thread_end()` with `JvmtiExport::post_vthread_end()` to have a unified check for the `JVMTI_PHASE_PRIMORDIAL`.
>>  -  to rename the local variable `cur_thread` as `thread` to follow the common pattern in `JvmtiExport::post_vthread_start()` and `JvmtiExport::post_vthread_end()`
>>  
>>  Testing: ran mach5 tiers 1-6. All tests are passed.
>
> Serguei Spitsyn has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review: removed unneeded comment

src/hotspot/share/prims/jvmtiExport.cpp line 1614:

> 1612: 
> 1613:   // Do not post virtual thread end event for hidden java thread.
> 1614:   if (state->is_enabled(JVMTI_EVENT_VIRTUAL_THREAD_END) &&

Should this be assert like in vthread_start?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16019#discussion_r1351061395


More information about the serviceability-dev mailing list