diff options
author | jim-p <jimp@pfsense.org> | 2013-08-30 13:35:48 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2013-08-30 13:37:54 -0400 |
commit | 3fcb6a21a33f2260b18b59100aee3ec69a3e3988 (patch) | |
tree | ce5d21df3c651ccc0b9aa9404b96d2bdf0df38f1 /usr/local/www/includes | |
parent | 35eb76fa91915877924bdefdb35b39c0404d7969 (diff) | |
download | pfsense-3fcb6a21a33f2260b18b59100aee3ec69a3e3988.zip pfsense-3fcb6a21a33f2260b18b59100aee3ec69a3e3988.tar.gz |
Show a count of the CPUs if more than one is detected, and show how those CPUs are supplied by the hardware.
Diffstat (limited to 'usr/local/www/includes')
-rw-r--r-- | usr/local/www/includes/functions.inc.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/usr/local/www/includes/functions.inc.php b/usr/local/www/includes/functions.inc.php index 4843a78..33cb585 100644 --- a/usr/local/www/includes/functions.inc.php +++ b/usr/local/www/includes/functions.inc.php @@ -242,6 +242,19 @@ function get_cpufreq() { return $out; } +function get_cpu_count($show_detail = false) { + $cpucount = ""; + exec("/sbin/sysctl -n kern.smp.cpus", $cpucount); + $cpucount = $cpucount[0]; + + if ($show_detail) { + $cpudetail = ""; + exec("/usr/bin/grep 'SMP.*package.*core' /var/log/dmesg.boot | /usr/bin/cut -f2- -d' '", $cpudetail); + $cpucount = $cpudetail[0]; + } + return $cpucount; +} + function get_load_average() { $load_average = ""; exec("/usr/bin/uptime | /usr/bin/sed 's/^.*: //'", $load_average); |