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

Description: Unnamed repository; edit this file to name it for gitweb.
Last Change: Wed 2/3/10 13:04

Recent Commits
Time
Signed-Off By
Description
Commit Diff
Wed 2/3/10 13:04
Michael Larabel  
phoromatic: Add... 
Wed 2/3/10 12:38
Michael Larabel  
phoromatic: Add... 
Wed 2/3/10 12:27
Michael Larabel  
phoromatic: Add... 
Wed 2/3/10 9:26
Michael Larabel  
pts: Drop MD5 hashes in... 
Tue 2/2/10 23:43
Michael Larabel  
phoromatic: Add... 
Tue 2/2/10 23:35
Michael Larabel  
pts-core: Phoromatic... 
 
> --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