Class CentralProcessor.PhysicalProcessor
- java.lang.Object
-
- oshi.hardware.CentralProcessor.PhysicalProcessor
-
- Enclosing interface:
- CentralProcessor
@Immutable public static class CentralProcessor.PhysicalProcessor extends java.lang.Object
A class representing a Physical Processor (a core) providing per-core statistics that may vary, particularly in hybrid/modular processors.
-
-
Field Summary
Fields Modifier and Type Field Description private int
efficiency
private java.lang.String
idString
private int
physicalPackageNumber
private int
physicalProcessorNumber
-
Constructor Summary
Constructors Constructor Description PhysicalProcessor(int physicalPackageNumber, int physicalProcessorNumber)
PhysicalProcessor(int physicalPackageNumber, int physicalProcessorNumber, int efficiency, java.lang.String idString)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getEfficiency()
Gets a platform specific measure of processor performance vs.java.lang.String
getIdString()
Gets a platform specific identification string representing this core.int
getPhysicalPackageNumber()
Gets the package id.int
getPhysicalProcessorNumber()
Gets the core id.java.lang.String
toString()
-
-
-
Method Detail
-
getPhysicalPackageNumber
public int getPhysicalPackageNumber()
Gets the package id. This is also the physical package number which corresponds toCentralProcessor.LogicalProcessor.getPhysicalPackageNumber()
.- Returns:
- the physicalProcessorNumber
-
getPhysicalProcessorNumber
public int getPhysicalProcessorNumber()
Gets the core id. This is also the physical processor number which corresponds toCentralProcessor.LogicalProcessor.getPhysicalProcessorNumber()
.- Returns:
- the physicalProcessorNumber
-
getEfficiency
public int getEfficiency()
Gets a platform specific measure of processor performance vs. efficiency, useful for identifying cores in hybrid/System on Chip (SoC) processors such as ARM's big.LITTLE architecture, Apple's M1, and Intel's P-core and E-core hybrid technology. A core with a higher value for the efficiency class has intrinsically greater performance and less efficiency than a core with a lower value for the efficiency class.- Returns:
- On Windows 10 and higher, returns the
EfficiencyClass
value from thePROCESSOR_RELATIONSHIP
structure.On macOS with Apple Silicon, emulates the same relative efficiency class values as Windows.
On Linux, returns the
cpu_capacity
value from sysfs. This is an optional cpu node property representing CPU capacity expressed in normalized DMIPS/MHz.On OpenBSD, FreeBSD, and Solaris with ARM big.LITTLE processors, emulates the same relative efficiency class values as Windows.
For unimplemented operating systems or architectures, returns 0.
- See Also:
- PROCESSOR_RELATIONSHIP, cpu-capacity
-
getIdString
public java.lang.String getIdString()
Gets a platform specific identification string representing this core. This string requires user parsing to obtain meaningful information. As this is an experimental feature, users should not rely on the format.- Returns:
- On Windows, returns the per-core Processor ID (CPUID).
On macOS, returns a compatibility string from the IO Registry identifying hybrid cores.
On Linux, returns the
MODALIAS
value for the core's driver.On OpenBSD, FreeBSD, and Solaris, returns a per-core CPU identification string.
For unimplemented operating systems, returns an empty string.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-