Announcement

Collapse
No announcement yet.

Single-Core CPUs reported as 'Unknown'

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Single-Core CPUs reported as 'Unknown'

    Hello,
    I found out, on Systems with Single-Core CPUs information about the processor are not shown (Processor: Unknown (Total Cores: 1). At least for AMD-Athlon 1000MHz, AthlonXP 2200+ and a mobile Intel Celeron 540.

    This is because there is no 'physical id' listed in /proc/cpuinfo, at least for the processors listed above.

    In regard to the corresponding file (pts-functions-system-cpu.php)
    Code:
    $physical_cpu_ids = read_cpuinfo("physical id");
    $physical_cpu_count = count(array_unique($physical_cpu_ids));
    ...
    ...
    if($physical_cpu_count == 1)
    {
        //just one processor
        $info = append_processor_fr...
    }
    will allways fail and $info stays empty and it will be reported 'Unknown'.
    A simple code change corrects this:

    Code:
    if($physical_cpu_count == 1 || empty($physical_cpu_count))
    not sure if this is the desired code quality , but i hope it helps in some way. At least on my systems with CPUs not reporting an physical id it works.
    Code:
     phoronix-test-suite system-info
    
    ======================================
    Phoronix Test Suite v1.0.4 (TRONDHEIM)
    System Information
    ======================================
    
    Hardware:
    Processor: Intel Celeron CPU 540 @ 1.86GHz (Total Cores: 1), Motherboard: Unknown, Chipset: Intel Mobile PM965/GM965/GL960, System Memory: 2018MB, Disk Space: 70GB, Graphics: Intel Mobile GM965/GL960, Screen Resolution: 1280x800
    Marox

  • #2
    Thanks, I'll commit it to git.
    Michael Larabel
    https://www.michaellarabel.com/

    Comment


    • #3
      Fix found in PTS 1.0.5 release today.
      Michael Larabel
      https://www.michaellarabel.com/

      Comment

      Working...
      X