Package oshi.hardware

Class 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 Detail

      • physicalPackageNumber

        private final int physicalPackageNumber
      • physicalProcessorNumber

        private final int physicalProcessorNumber
      • efficiency

        private final int efficiency
      • idString

        private final java.lang.String idString
    • Constructor Detail

      • PhysicalProcessor

        public PhysicalProcessor​(int physicalPackageNumber,
                                 int physicalProcessorNumber)
      • PhysicalProcessor

        public PhysicalProcessor​(int physicalPackageNumber,
                                 int physicalProcessorNumber,
                                 int efficiency,
                                 java.lang.String idString)
    • Method Detail

      • 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 the PROCESSOR_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 class java.lang.Object