RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU [v5]
Yasumasa Suenaga
ysuenaga at openjdk.org
Wed Oct 8 06:53:28 UTC 2025
On Wed, 8 Oct 2025 06:14:03 GMT, Yasumasa Suenaga <ysuenaga at openjdk.org> wrote:
>> src/hotspot/share/jfr/metadata/metadata.xml line 855:
>>
>>> 853:
>>> 854: <Event name="CPUInformation" category="Operating System, Processor" label="CPU Information"
>>> 855: description="Characteristics and descriptions of the processor(s) the JVM is running on. Note that "cores" field would be incorrect on hybrid CPU."
>>
>> Perhaps better stated on the cores field:
>>
>> <Field type="uint" name="cores" label="Cores (approximation on a hybrid CPU" />
>>
>> ? But really this is for JFR folk to decide. Do these labels get used for GUI tools like JMC?
>>
>> BTW I assume that "hwThreads" is the number of logical processors - right?
>
>> BTW I assume that "hwThreads" is the number of logical processors - right?
>
> Yes
> Perhaps better stated on the cores field:
Thanks for your comment! I added that sentence to `description` attribute in `Field` element.
After this change, flight record contains following metadata. I believe it would be parsed in some tools like JMC (JMC shows the description as a tooltip)
$ jfr metadata --events jdk.CPUInformation /tmp/test.jfr
@Name("jdk.CPUInformation")
@Category({"Operating System", "Processor"})
@Label("CPU Information")
@Description("Characteristics and descriptions of the processor(s) the JVM is running on")
class CPUInformation extends jdk.jfr.Event {
@Label("Start Time")
@Timestamp("TICKS")
long startTime;
@Label("Type")
String cpu;
@Label("Description")
String description;
@Unsigned
@Label("Sockets")
int sockets;
@Unsigned
@Label("Cores")
@Description("Approximation on a hybrid CPU")
int cores;
@Unsigned
@Label("Hardware Threads")
int hwThreads;
}
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27080#discussion_r2412763021
More information about the hotspot-dev
mailing list