RFR: 8366847: JFR reports incorrect number of cores on hybrid CPU
Yasumasa Suenaga
ysuenaga at openjdk.org
Fri Sep 5 01:26:25 UTC 2025
On Thu, 4 Sep 2025 15:06:08 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
> If a value is missing, emit jmc_undefined_long in event.set_cores(...), so it will show up as N/A in both JMC and the JFR tool.
It couldn't for now because `cores` is declared as `uint`.
<Field type="uint" name="cores" label="Cores" />
I checked generated code from `metadata.xml`, the field as declared as `uint` (32 bit), so we cannot store `jmc_undefined_long` as `long`.
class EventCPUInformation : public JfrEvent<EventCPUInformation>
{
private:
const char* _cpu;
const char* _description;
unsigned _sockets;
unsigned _cores;
unsigned _hwThreads;
But I agree with @egahlin to show up "N/A" in this case. I think it is the most simple way to change data type to `long` for number of CPU cores in `metadata.xml`. Can we do that? I concern the impact for JFR recording data format.
As an another option, we can update `EventPrintWriter::getUnsigned` to handle `unsigned int` - it might be reasonable to fix this problem.
Which solution is better?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27080#issuecomment-3256751516
More information about the hotspot-dev
mailing list