RFR: 8330064: JFR: Incorrect function declarations for register/unregister_stack_filter
David Holmes
dholmes at openjdk.org
Mon Apr 15 07:34:48 UTC 2024
On Sat, 13 Apr 2024 13:47:40 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> The commit from [JDK-8314745](https://bugs.openjdk.org/browse/JDK-8314745) contains
>>
>> jlong JNICALL jfr_register_stack_filter(JNIEnv* env, jobject classes, jobject methods);
>> jlong JNICALL jfr_unregister_stack_filter(JNIEnv* env, jlong start_filter_id);
>>
>> in `jfrJniMethod.hpp`, but the definitions have different signatures:
>>
>> JVM_ENTRY_NO_ENV(jlong, jfr_register_stack_filter(JNIEnv* env, jclass jvm, jobjectArray classes, jobjectArray methods))
>> return JfrStackFilterRegistry::add(classes, methods, thread);
>> JVM_END
>>
>> JVM_ENTRY_NO_ENV(void, jfr_unregister_stack_filter(JNIEnv* env, jclass jvm, jlong id))
>> JfrStackFilterRegistry::remove(id);
>> JVM_END
>>
>>
>> This fixes the declarations to match the definitions.
>>
>> The issue was detected attempting a 32-bit Windows built. Unclear why our main toolchains have not complained about this.
>>
>> Testing:
>> - tiers 1-3 (sanity)
>> - GHA
>
> Thumbs up. That's quite the parameter mismatch for our main compilers to miss.
Thanks for the reviews @dcubed-ojdk , @egahlin and @TheShermanTanker !
@dcubed-ojdk I was also very surprised our main compilers did not catch this!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18733#issuecomment-2055854859
More information about the hotspot-jfr-dev
mailing list