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:42 -0400
commitb097a7cfa9f42d513823f0db7f047684faf8fe28 (patch)
tree779fe4b0f530d75e3ecf94e1f5101f712c8f4446 /usr/local/www/includes/functions.inc.php
parentbeb7cd97eb496e2d1f1e933344566e8e1927378f (diff)
downloadpfsense-b097a7cfa9f42d513823f0db7f047684faf8fe28.zip
pfsense-b097a7cfa9f42d513823f0db7f047684faf8fe28.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 2d3295a..6a60fcf 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