aboutsummaryrefslogtreecommitdiff
path: root/benchmarks/apib
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2018-03-03 11:47:21 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2018-03-03 11:47:21 +0000
commit08fe9afadacb943aa3762992cfb09b45b5b272a7 (patch)
tree6a4eb01cfe11fecaa424e730d6e44b67554e7ed3 /benchmarks/apib
parent5b7d37cfeafa9fc2bc6aeb7994c1bf61ec96e74c (diff)
downloadports-08fe9afadacb943aa3762992cfb09b45b5b272a7.tar.gz
ports-08fe9afadacb943aa3762992cfb09b45b5b272a7.zip
Adjust code comments and add one missing linefeed.
Notes
Notes: svn path=/head/; revision=463480
Diffstat (limited to 'benchmarks/apib')
-rw-r--r--benchmarks/apib/files/patch-src_apib__cpu.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/benchmarks/apib/files/patch-src_apib__cpu.c b/benchmarks/apib/files/patch-src_apib__cpu.c
index 5aa215d2a754..f0af2c4f6940 100644
--- a/benchmarks/apib/files/patch-src_apib__cpu.c
+++ b/benchmarks/apib/files/patch-src_apib__cpu.c
@@ -22,7 +22,7 @@
apr_status_t s;
apr_file_t* f;
char buf[PROC_BUF_LEN];
-@@ -66,10 +74,19 @@ int cpu_Count(apr_pool_t* pool)
+@@ -66,10 +74,20 @@ int cpu_Count(apr_pool_t* pool)
count = 1;
}
return count;
@@ -33,6 +33,7 @@
{
+#ifdef __FreeBSD__
+ struct tms ticks;
++
+ cpu->idle = times(&ticks);
+ if (cpu->idle == -1)
+ return 0;
@@ -42,7 +43,7 @@
apr_status_t s;
apr_file_t* proc;
char buf[PROC_BUF_LEN];
-@@ -118,10 +135,12 @@ static int getTicks(CPUUsage* cpu, apr_pool_t* pool)
+@@ -118,10 +136,12 @@ static int getTicks(CPUUsage* cpu, apr_pool_t* pool)
}
return 0;
@@ -55,7 +56,7 @@
apr_status_t s;
apr_file_t* proc;
char buf[PROC_BUF_LEN];
-@@ -138,12 +157,36 @@ double cpu_GetMemoryUsage(apr_pool_t* pool)
+@@ -138,12 +158,36 @@ double cpu_GetMemoryUsage(apr_pool_t* pool)
if (s != APR_SUCCESS) {
return 0.0;
}
@@ -67,7 +68,7 @@
long cache = 0;
+#ifdef __FreeBSD__
-+ /* Let's work with kilobytes. */
++ /* We work with kilobytes to match Linux' /proc/meminfo. */
+ long pagesize = sysconf(_SC_PAGESIZE) / 1024;
+ totalMem = sysconf(_SC_PHYS_PAGES) * pagesize;
+
@@ -83,7 +84,7 @@
+ sysctlbyname("vfs.bufspace", &buffers, &len, NULL, 0);
+ buffers /= 1024;
+
-+ /* `cache' is number of inactive pages since r309017. */
++ /* `cache' is based on number of inactive pages since r309017. */
+ unsigned inact;
+ len = sizeof(inact);
+ sysctlbyname("vm.stats.vm.v_inactive_count", &inact, &len, NULL, 0);
@@ -92,7 +93,7 @@
while (linep_NextLine(&line)) {
char* n = linep_NextToken(&line, " ");
char* v = linep_NextToken(&line, " ");
-@@ -158,6 +201,7 @@ double cpu_GetMemoryUsage(apr_pool_t* pool)
+@@ -158,6 +202,7 @@ double cpu_GetMemoryUsage(apr_pool_t* pool)
cache = atol(v);
}
}