Class CentralProcessor.PhysicalProcessor

java.lang.Object
oshi.hardware.CentralProcessor.PhysicalProcessor
Enclosing interface:
CentralProcessor

@PublicApi @Immutable public static class CentralProcessor.PhysicalProcessor extends Object
A class representing a Physical Processor (a core) providing per-core statistics that may vary, particularly in hybrid/modular processors.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PhysicalProcessor(int physicalPackageNumber, int physicalProcessorNumber)
    Creates a PhysicalProcessor with the given package and processor numbers.
    PhysicalProcessor(int physicalPackageNumber, int physicalProcessorNumber, int efficiency, String idString)
    Creates a PhysicalProcessor with the given package, processor, efficiency, and ID string.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    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.
    Gets a platform specific identification string representing this core.
    int
    Gets the package id.
    int
    Gets the core id.
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • PhysicalProcessor

      public PhysicalProcessor(int physicalPackageNumber, int physicalProcessorNumber)
      Creates a PhysicalProcessor with the given package and processor numbers.
      Parameters:
      physicalPackageNumber - the package/socket number
      physicalProcessorNumber - the core number
    • PhysicalProcessor

      public PhysicalProcessor(int physicalPackageNumber, int physicalProcessorNumber, int efficiency, String idString)
      Creates a PhysicalProcessor with the given package, processor, efficiency, and ID string.
      Parameters:
      physicalPackageNumber - the package/socket number
      physicalProcessorNumber - the core number
      efficiency - the efficiency class of this core
      idString - an identifier string for this core
  • Method Details

    • getPhysicalPackageNumber

      public int getPhysicalPackageNumber()
      Gets the package id. This is also the physical package number which corresponds to CentralProcessor.LogicalProcessor.getPhysicalPackageNumber().
      Returns:
      the physicalProcessorNumber
    • getPhysicalProcessorNumber

      public int getPhysicalProcessorNumber()
      Gets the core id. This is also the physical processor number which corresponds to CentralProcessor.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 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:
    • getIdString

      public 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 String toString()
      Overrides:
      toString in class Object