diff options
author | Michael Larabel <michael@phx-laptop.(none)> | 2008-07-17 18:31:30 -0400 |
---|---|---|
committer | Michael Larabel <michael@phx-laptop.(none)> | 2008-08-03 11:49:20 -0400 |
commit | d65d83f7338a0bae690fae42449e9d3636b89a83 (patch) | |
tree | 72213926a13d21da51eb7cb97107fc3291e669e6 /pts-core/functions/pts-functions_system_cpu.php | |
parent | 2874a72c5da280f8c8dbfaa828e34da4af964897 (diff) | |
download | phoronix-test-suite-upstream-d65d83f7338a0bae690fae42449e9d3636b89a83.tar.gz phoronix-test-suite-upstream-d65d83f7338a0bae690fae42449e9d3636b89a83.tar.xz phoronix-test-suite-upstream-d65d83f7338a0bae690fae42449e9d3636b89a83.zip |
pts-core: Add BSD CPU detection support
Diffstat (limited to 'pts-core/functions/pts-functions_system_cpu.php')
-rw-r--r-- | pts-core/functions/pts-functions_system_cpu.php | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pts-core/functions/pts-functions_system_cpu.php b/pts-core/functions/pts-functions_system_cpu.php index d9842ac..f3f18df 100644 --- a/pts-core/functions/pts-functions_system_cpu.php +++ b/pts-core/functions/pts-functions_system_cpu.php @@ -23,16 +23,24 @@ function cpu_core_count() { - if(IS_SOLARIS) + if(IS_LINUX) + { + $processors = read_cpuinfo("processor"); + $info = count($processors); + } + else if(IS_SOLARIS) { $info = trim(shell_exec("psrinfo")); $info = explode("\n", $info); $info = count($info); } + else if(IS_BSD) + { + $info = read_sysctl("hw.ncpu"); + } else { - $processors = read_cpuinfo("processor"); - $info = count($processors); + $processors = 1; } return $info; @@ -97,6 +105,10 @@ function processor_string() $info = substr($info, strrpos($info, "cpu0:") + 6); $info = append_processor_frequency(pts_clean_information_string($info), 0); } + else if(IS_BSD) + { + $info = read_sysctl("hw.model"); + } else $info = "Unknown"; } |