RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v2]

Yasumasa Suenaga ysuenaga at openjdk.org
Tue Sep 9 11:58:56 UTC 2025


On Tue, 9 Sep 2025 11:32:20 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:

>>> you might want to check the event in JMC just to be sure. 
>> 
>> I checked the flight record, but JMC 9.1 showed raw min_jlong value. I think it is a problem on JMC.
>> 
>> <img width="812" height="340" alt="image" src="https://github.com/user-attachments/assets/1919ac46-77c5-4658-8fa1-8aea7aa6bef2" />
>> 
>> 
>>> Problem might be the API, e.g. int cores = event.getInt("cores") or Integer cores = event.getValue("cores").
>> 
>> I hope the problem would be found by jdk_jfr tests - it passed on both GHA and my Linux box.
>
>> I checked the flight record, but JMC 9.1 showed raw min_jlong value. I think it is a problem on JMC.
> 
> Interesting, it has worked in the past.
> 
>> I hope the problem would be found by jdk_jfr tests
> 
> Try to add:
> 
>     +           event.getInt("cores");
>     +           Integer value = event.getValue("cores");
>  
> to TestCPUInformation.java. There's no need to check in the changes, but it would be good to know what happens if it is a long value.

@egahlin 

`event.getInt("cores")`: failed

java.lang.IllegalArgumentException: Attempt to get field "cores" with illegal data type conversion int
        at jdk.jfr/jdk.jfr.consumer.RecordedObject.newIllegalArgumentException(RecordedObject.java:890)
        at jdk.jfr/jdk.jfr.consumer.RecordedObject.getInt(RecordedObject.java:553)
        at jdk.jfr.event.os.TestCPUInformation.main(TestCPUInformation.java:56)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:565)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1474)


`Integer value = event.getValue("cores")`: failed

java.lang.ClassCastException: class java.lang.Long cannot be cast to class java.lang.Integer (java.lang.Long and java.lang.Integer are in module java.base of loader 'bootstrap')
        at jdk.jfr.event.os.TestCPUInformation.main(TestCPUInformation.java:57)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:565)
        at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
        at java.base/java.lang.Thread.run(Thread.java:1474)

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

PR Comment: https://git.openjdk.org/jdk/pull/27080#issuecomment-3270354691


More information about the hotspot-jfr-dev mailing list