summaryrefslogtreecommitdiffstats
path: root/usr/local/www/includes/functions.inc.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2013-08-30 13:35:48 -0400
committerjim-p <jimp@pfsense.org>2013-08-30 13:37:54 -0400
commit3fcb6a21a33f2260b18b59100aee3ec69a3e3988 (patch)
treece5d21df3c651ccc0b9aa9404b96d2bdf0df38f1 /usr/local/www/includes/functions.inc.php
parent35eb76fa91915877924bdefdb35b39c0404d7969 (diff)
downloadpfsense-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/functions.inc.php')
-rw-r--r--usr/local/www/includes/functions.inc.php13
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);
OpenPOWER on IntegriCloud