mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 09:49:18 -04:00
benchmarks/unixbench: Add support to parallel execution
Add support to get the number of CPUs on FreeBSD. Bump PORTREVISION. PR: 247293 Submitted by: Yuichiro NAITO <naito.yuichiro@gmail.com>
This commit is contained in:
parent
709dd0f0a2
commit
f35239963a
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=541217
2 changed files with 26 additions and 7 deletions
|
@ -4,7 +4,7 @@
|
||||||
PORTNAME= unixbench
|
PORTNAME= unixbench
|
||||||
DISTVERSIONPREFIX= v
|
DISTVERSIONPREFIX= v
|
||||||
DISTVERSION= 5.1.3
|
DISTVERSION= 5.1.3
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= benchmarks
|
CATEGORIES= benchmarks
|
||||||
|
|
||||||
MAINTAINER= pizzamig@FreeBSD.org
|
MAINTAINER= pizzamig@FreeBSD.org
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
--- Run.orig 2017-09-04 20:35:19 UTC
|
--- Run.orig 2020-06-11 08:18:10 UTC
|
||||||
+++ Run
|
+++ Run
|
||||||
@@ -91,10 +91,10 @@ chomp($BASEDIR);
|
@@ -91,10 +91,10 @@ chomp($BASEDIR);
|
||||||
my $BINDIR = getDir('UB_BINDIR', $BASEDIR . "/pgms");
|
my $BINDIR = getDir('UB_BINDIR', $BASEDIR . "/pgms");
|
||||||
|
@ -13,7 +13,26 @@
|
||||||
|
|
||||||
# Directory where the tests are executed.
|
# Directory where the tests are executed.
|
||||||
my $TESTDIR = getDir('UB_TESTDIR', $BASEDIR . "/testdir");
|
my $TESTDIR = getDir('UB_TESTDIR', $BASEDIR . "/testdir");
|
||||||
@@ -735,12 +735,10 @@ sub getSystemInfo {
|
@@ -672,6 +672,18 @@ sub processCpuFlags {
|
||||||
|
# these fields:
|
||||||
|
# describing the model etc. Returns undef if the information can't be got.
|
||||||
|
sub getCpuInfo {
|
||||||
|
+ my $ncpu = getCmdOutput("sysctl -n hw.ncpu");
|
||||||
|
+ my $cpus = [ ];
|
||||||
|
+ my $i;
|
||||||
|
+ for ($i=0;$i<$ncpu;$i++) {
|
||||||
|
+ $cpus->[$i]{'model'} = getCmdOutput("sysctl -n hw.model");
|
||||||
|
+ $cpus->[$i]{'bogo'} = 0;
|
||||||
|
+ $cpus->[$i]{'flags'} = getCmdOutput("sysctl -n hw.machine");
|
||||||
|
+ }
|
||||||
|
+ $cpus;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+sub getCpuInfoBak {
|
||||||
|
open(my $fd, "<", "/proc/cpuinfo") || return undef;
|
||||||
|
|
||||||
|
my $cpus = [ ];
|
||||||
|
@@ -735,12 +747,10 @@ sub getSystemInfo {
|
||||||
|
|
||||||
# Get the language info.
|
# Get the language info.
|
||||||
my $lang = getCmdOutput("printenv LANG");
|
my $lang = getCmdOutput("printenv LANG");
|
||||||
|
@ -29,7 +48,7 @@
|
||||||
|
|
||||||
# Get details on the CPUs, if possible.
|
# Get details on the CPUs, if possible.
|
||||||
my $cpus = getCpuInfo();
|
my $cpus = getCpuInfo();
|
||||||
@@ -750,10 +748,9 @@ sub getSystemInfo {
|
@@ -750,10 +760,9 @@ sub getSystemInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get graphics hardware info.
|
# Get graphics hardware info.
|
||||||
|
@ -41,7 +60,7 @@
|
||||||
$info->{'load'} = getCmdOutput("uptime");
|
$info->{'load'} = getCmdOutput("uptime");
|
||||||
$info->{'numUsers'} = getCmdOutput("who | wc -l");
|
$info->{'numUsers'} = getCmdOutput("who | wc -l");
|
||||||
|
|
||||||
@@ -781,6 +778,7 @@ sub abortRun {
|
@@ -781,6 +790,7 @@ sub abortRun {
|
||||||
|
|
||||||
# Do checks that everything's ready for testing.
|
# Do checks that everything's ready for testing.
|
||||||
sub preChecks {
|
sub preChecks {
|
||||||
|
@ -49,7 +68,7 @@
|
||||||
# Set the language.
|
# Set the language.
|
||||||
$ENV{'LANG'} = $language;
|
$ENV{'LANG'} = $language;
|
||||||
|
|
||||||
@@ -1386,7 +1384,7 @@ sub displaySystem {
|
@@ -1386,7 +1396,7 @@ sub displaySystem {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Display system load and usage info.
|
# Display system load and usage info.
|
||||||
|
@ -58,7 +77,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1603,8 +1601,8 @@ sub displaySystemHtml {
|
@@ -1603,8 +1613,8 @@ sub displaySystemHtml {
|
||||||
# Display system runlevel, load and usage info.
|
# Display system runlevel, load and usage info.
|
||||||
printf $fd "<tr>\n";
|
printf $fd "<tr>\n";
|
||||||
printf $fd " <td><b>Uptime:</b></td>\n";
|
printf $fd " <td><b>Uptime:</b></td>\n";
|
||||||
|
|
Loading…
Add table
Reference in a new issue