[crac] RFR: Propagating CRaC event to JVMTI agents [v3]
Anton Kozlov
akozlov at openjdk.org
Thu Nov 23 10:13:43 UTC 2023
On Tue, 21 Nov 2023 19:42:59 GMT, Roman Marchenko <rmarchenko at openjdk.org> wrote:
>> This change implements propagation of CRaC events to JVMTI.
>>
>> - New JVMTI extension events are introduced - `EXT_EVENT_CRAC_BEFORE_CHECKPOINT` and `EXT_EVENT_CRAC_AFTER_RESTORE`.
>> - JVMTI agents should subscribe/unsubscribe to the events using `SetExtensionEventCallback` JVMTI method.
>> - Setting/unsetting a callback will enable/disable sending an appropriate event to an agent, i.e. there is no need to additionally call `SetEventNotificationMode` method by an agent.
>> - See `test/jdk/jdk/crac/jvmtiEvents/libCracJvmtiAgent.c` for an example of CRaC-ready JVMTI agent
>
> Roman Marchenko has updated the pull request incrementally with one additional commit since the last revision:
>
> Fixed test
src/hotspot/share/prims/jvmtiEventController.cpp line 1:
> 1: /*
I see some potential places to modify, e.g. line 699. It would make sense at least place a comment where new extenstion eventns are intentionally not added.
src/hotspot/share/prims/jvmtiEventController.cpp line 829:
> 827: case EXT_EVENT_CRAC_BEFORE_CHECKPOINT :
> 828: ext_callbacks->CracBeforeCheckpoint = callback;
> 829: env->env_event_enable()->set_user_enabled(event_type, enabling);
Why UNLOAD/MOUNT/UNMOUNT do not require this?
src/hotspot/share/prims/jvmtiUtil.hpp line 60:
> 58: }
> 59: if (num >= EXT_MIN_EVENT_TYPE_VAL && num <= EXT_MAX_EVENT_TYPE_VAL) {
> 60: return (num != EXT_EVENT_CLASS_UNLOAD && num != EXT_EVENT_CRAC_BEFORE_CHECKPOINT && num != EXT_EVENT_CRAC_AFTER_RESTORE);
Any idea why `EXT_EVENT_VIRTUAL_THREAD_MOUNT`/`UNMOUNT` are not listed here?
-------------
PR Review Comment: https://git.openjdk.org/crac/pull/143#discussion_r1403168574
PR Review Comment: https://git.openjdk.org/crac/pull/143#discussion_r1403163688
PR Review Comment: https://git.openjdk.org/crac/pull/143#discussion_r1403162667
More information about the crac-dev
mailing list