projects / phoronix-test-suite.git / commitdiff
Build Results
 
Summary

Description: Unnamed repository; edit this file to name it for gitweb.
Last Change: Mon 8/30/10 20:43

Recent Commits
Time
Signed-Off By
Description
Commit Diff
Mon 8/30/10 20:43
Michael Larabel  
 
Mon 8/30/10 20:37
Michael Larabel  
pts-core: Last minute... 
Sat 8/28/10 12:53
Michael Larabel  
pts-core: Detect if a... 
Sat 8/28/10 10:34
Michael Larabel  
pts-core: Fix test result... 
Fri 8/27/10 8:51
Michael Larabel  
pts-core: When doing a... 
Wed 8/25/10 18:46
Michael Larabel  
 
 
> --git a/pts-core/functions/pts-functions_linux.php b/pts-core/functions/pts-functions_linux.php
index df2607f
..61b6004 100644
--- a/pts-core/functions/pts-functions_linux.php
+++ b/pts-core/functions/pts-functions_linux.php
@@ -22,+22,@@ function cpu_job_count()
 {
     return 
cpu_core_count() + 1;
 }
-
 function 
processor_string()
 {
     
//TODO: Support Multiple CPUs
@@ -32,11 +31,39 @@ function processor_string()
         
$info file_get_contents("/proc/cpuinfo");
         
$info substr($infostrpos($info"model name"));
         
$info trim(substr($infostrpos($info":") + 1strpos($info"\n") - strpos($info":")));
-        
$info str_replace(array("Corporation ""Technologies ""Processor ""processor ""(R)""(TM)"), ""$info);
+        
$info str_replace(array("Corporation ""Technologies ""Processor ""processor ""(R)""(TM)""(tm)""Technology "), ""$info);
     }
     else
         
$info "Unknown";

+    if((
$freq processor_frequency()) > 0)
+    {
+        if((
$strip_point strpos($info'@')) > 0)
+            
$info trim(substr($info0$strip_point)); // stripping out the reported freq, since the CPU could be overclocked
+
+        
$info .= " @ " $freq "GHz";
+    }
+
+    return 
$info;
+}
+function 
processor_frequency()
+{
+
+    if(
is_file("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq")) // The ideal way, with modern CPUs using CnQ or EIST and cpuinfo reporting the current
+    {
+        
$info trim(file_get_contents("/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq"));
+        
$info pts_trim_double(intval($info) / 10000002);
+    }
+    else if(
is_file("/proc/cpuinfo")) // fall back for those without cpufreq
+    {
+        
$info file_get_contents("/proc/cpuinfo");
+        
$info substr($infostrpos($info"\ncpu MHz"));
+        
$info trim(substr($infostrpos($info":") + 1strpos($info"\n") - strpos($info":")));
+        
$info pts_trim_double(intval($info) / 10002);
+    }
+    else
+        
$info 0;
+
     return 
$info;
 }
 function 
memory_mb_capacity()
<
 
Phoronix.com
Linux Driver Forums
Copyright © 2010 by Phoronix Media