Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
02af3cb5
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
02af3cb5
编写于
4月 19, 2011
作者:
D
Dominik Brodowski
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cpupowerutils: bench - ConfigStyle bugfixes
Signed-off-by:
N
Dominik Brodowski
<
linux@dominikbrodowski.net
>
上级
f5ac0641
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
75 addition
and
58 deletion
+75
-58
tools/power/cpupower/Makefile
tools/power/cpupower/Makefile
+2
-3
tools/power/cpupower/bench/benchmark.c
tools/power/cpupower/bench/benchmark.c
+29
-19
tools/power/cpupower/bench/benchmark.h
tools/power/cpupower/bench/benchmark.h
+5
-3
tools/power/cpupower/bench/config.h
tools/power/cpupower/bench/config.h
+1
-1
tools/power/cpupower/bench/main.c
tools/power/cpupower/bench/main.c
+3
-4
tools/power/cpupower/bench/parse.c
tools/power/cpupower/bench/parse.c
+19
-18
tools/power/cpupower/bench/parse.h
tools/power/cpupower/bench/parse.h
+8
-5
tools/power/cpupower/bench/system.c
tools/power/cpupower/bench/system.c
+8
-5
未找到文件。
tools/power/cpupower/Makefile
浏览文件 @
02af3cb5
...
@@ -38,7 +38,7 @@ NLS ?= true
...
@@ -38,7 +38,7 @@ NLS ?= true
CPUFRQ_BENCH
?=
true
CPUFRQ_BENCH
?=
true
# Prefix to the directories we're installing to
# Prefix to the directories we're installing to
DESTDIR
?=
DESTDIR
?=
# --- CONFIGURATION END ---
# --- CONFIGURATION END ---
...
@@ -277,5 +277,4 @@ uninstall:
...
@@ -277,5 +277,4 @@ uninstall:
rm
-f
$(DESTDIR)${localedir}
/
$$
HLANG/LC_MESSAGES/cpupowerutils.mo
;
\
rm
-f
$(DESTDIR)${localedir}
/
$$
HLANG/LC_MESSAGES/cpupowerutils.mo
;
\
done
;
done
;
.PHONY
:
all utils libcpufreq update-po create-gmo install-lib install-tools install-man install-gmo install uninstall
\
.PHONY
:
all utils libcpufreq update-po create-gmo install-lib install-tools install-man install-gmo install uninstall clean
clean
tools/power/cpupower/bench/benchmark.c
浏览文件 @
02af3cb5
...
@@ -37,7 +37,7 @@ if (config->output != stdout) { \
...
@@ -37,7 +37,7 @@ if (config->output != stdout) { \
* compute how many rounds of calculation we should do
* compute how many rounds of calculation we should do
* to get the given load time
* to get the given load time
*
*
* @param load aimed load time in s
* @param load aimed load time in
µ
s
*
*
* @retval rounds of calculation
* @retval rounds of calculation
**/
**/
...
@@ -61,9 +61,8 @@ unsigned int calculate_timespace(long load, struct config *config)
...
@@ -61,9 +61,8 @@ unsigned int calculate_timespace(long load, struct config *config)
timed
=
(
unsigned
int
)(
then
-
now
);
timed
=
(
unsigned
int
)(
then
-
now
);
/* approximation of the wanted load time by comparing with the
/* approximation of the wanted load time by comparing with the
* initial calculation time */
* initial calculation time */
for
(
i
=
0
;
i
<
4
;
i
++
)
for
(
i
=
0
;
i
<
4
;
i
++
)
{
{
rounds
=
(
unsigned
int
)(
load
*
estimated
/
timed
);
rounds
=
(
unsigned
int
)(
load
*
estimated
/
timed
);
dprintf
(
"calibrating with %u rounds
\n
"
,
rounds
);
dprintf
(
"calibrating with %u rounds
\n
"
,
rounds
);
now
=
get_time
();
now
=
get_time
();
...
@@ -102,11 +101,11 @@ void start_benchmark(struct config *config)
...
@@ -102,11 +101,11 @@ void start_benchmark(struct config *config)
load_time
=
config
->
load
;
load_time
=
config
->
load
;
/* For the progress bar */
/* For the progress bar */
for
(
_round
=
1
;
_round
<=
config
->
rounds
;
_round
++
)
for
(
_round
=
1
;
_round
<=
config
->
rounds
;
_round
++
)
total_time
+=
_round
*
(
config
->
sleep
+
config
->
load
);
total_time
+=
_round
*
(
config
->
sleep
+
config
->
load
);
total_time
*=
2
;
/* powersave and performance cycles */
total_time
*=
2
;
/* powersave and performance cycles */
for
(
_round
=
0
;
_round
<
config
->
rounds
;
_round
++
)
{
for
(
_round
=
0
;
_round
<
config
->
rounds
;
_round
++
)
{
performance_time
=
0LL
;
performance_time
=
0LL
;
powersave_time
=
0LL
;
powersave_time
=
0LL
;
...
@@ -130,9 +129,10 @@ void start_benchmark(struct config *config)
...
@@ -130,9 +129,10 @@ void start_benchmark(struct config *config)
fprintf
(
config
->
output
,
"%u %li %li "
,
fprintf
(
config
->
output
,
"%u %li %li "
,
_round
,
load_time
,
sleep_time
);
_round
,
load_time
,
sleep_time
);
if
(
config
->
verbose
)
{
if
(
config
->
verbose
)
printf
(
"avarage: %lius, rps:%li
\n
"
,
load_time
/
calculations
,
1000000
*
calculations
/
load_time
);
printf
(
"avarage: %lius, rps:%li
\n
"
,
}
load_time
/
calculations
,
1000000
*
calculations
/
load_time
);
/* do some sleep/load cycles with the performance governor */
/* do some sleep/load cycles with the performance governor */
for
(
cycle
=
0
;
cycle
<
config
->
cycles
;
cycle
++
)
{
for
(
cycle
=
0
;
cycle
<
config
->
cycles
;
cycle
++
)
{
...
@@ -142,10 +142,14 @@ void start_benchmark(struct config *config)
...
@@ -142,10 +142,14 @@ void start_benchmark(struct config *config)
then
=
get_time
();
then
=
get_time
();
performance_time
+=
then
-
now
-
sleep_time
;
performance_time
+=
then
-
now
-
sleep_time
;
if
(
config
->
verbose
)
if
(
config
->
verbose
)
printf
(
"performance cycle took %lius, sleep: %lius, load: %lius, rounds: %u
\n
"
,
printf
(
"performance cycle took %lius, "
(
long
)(
then
-
now
),
sleep_time
,
load_time
,
calculations
);
"sleep: %lius, "
"load: %lius, rounds: %u
\n
"
,
(
long
)(
then
-
now
),
sleep_time
,
load_time
,
calculations
);
}
}
fprintf
(
config
->
output
,
"%li "
,
performance_time
/
config
->
cycles
);
fprintf
(
config
->
output
,
"%li "
,
performance_time
/
config
->
cycles
);
progress_time
+=
sleep_time
+
load_time
;
progress_time
+=
sleep_time
+
load_time
;
show_progress
(
total_time
,
progress_time
);
show_progress
(
total_time
,
progress_time
);
...
@@ -155,7 +159,8 @@ void start_benchmark(struct config *config)
...
@@ -155,7 +159,8 @@ void start_benchmark(struct config *config)
if
(
set_cpufreq_governor
(
config
->
governor
,
config
->
cpu
)
!=
0
)
if
(
set_cpufreq_governor
(
config
->
governor
,
config
->
cpu
)
!=
0
)
return
;
return
;
/* again, do some sleep/load cycles with the powersave governor */
/* again, do some sleep/load cycles with the
* powersave governor */
for
(
cycle
=
0
;
cycle
<
config
->
cycles
;
cycle
++
)
{
for
(
cycle
=
0
;
cycle
<
config
->
cycles
;
cycle
++
)
{
now
=
get_time
();
now
=
get_time
();
usleep
(
sleep_time
);
usleep
(
sleep_time
);
...
@@ -163,22 +168,27 @@ void start_benchmark(struct config *config)
...
@@ -163,22 +168,27 @@ void start_benchmark(struct config *config)
then
=
get_time
();
then
=
get_time
();
powersave_time
+=
then
-
now
-
sleep_time
;
powersave_time
+=
then
-
now
-
sleep_time
;
if
(
config
->
verbose
)
if
(
config
->
verbose
)
printf
(
"powersave cycle took %lius, sleep: %lius, load: %lius, rounds: %u
\n
"
,
printf
(
"powersave cycle took %lius, "
(
long
)(
then
-
now
),
sleep_time
,
load_time
,
calculations
);
"sleep: %lius, "
"load: %lius, rounds: %u
\n
"
,
(
long
)(
then
-
now
),
sleep_time
,
load_time
,
calculations
);
}
}
progress_time
+=
sleep_time
+
load_time
;
progress_time
+=
sleep_time
+
load_time
;
/* compare the avarage sleep/load cycles */
/* compare the avarage sleep/load cycles */
fprintf
(
config
->
output
,
"%li "
,
powersave_time
/
config
->
cycles
);
fprintf
(
config
->
output
,
"%li "
,
fprintf
(
config
->
output
,
"%.3f
\n
"
,
performance_time
*
100
.
0
/
powersave_time
);
powersave_time
/
config
->
cycles
);
fprintf
(
config
->
output
,
"%.3f
\n
"
,
performance_time
*
100
.
0
/
powersave_time
);
fflush
(
config
->
output
);
fflush
(
config
->
output
);
if
(
config
->
verbose
)
if
(
config
->
verbose
)
printf
(
"performance is at %.2f%%
\n
"
,
performance_time
*
100
.
0
/
powersave_time
);
printf
(
"performance is at %.2f%%
\n
"
,
performance_time
*
100
.
0
/
powersave_time
);
sleep_time
+=
config
->
sleep_step
;
sleep_time
+=
config
->
sleep_step
;
load_time
+=
config
->
load_step
;
load_time
+=
config
->
load_step
;
}
}
}
}
tools/power/cpupower/bench/benchmark.h
浏览文件 @
02af3cb5
...
@@ -19,9 +19,11 @@
...
@@ -19,9 +19,11 @@
/* load loop, this schould take about 1 to 2ms to complete */
/* load loop, this schould take about 1 to 2ms to complete */
#define ROUNDS(x) {unsigned int rcnt; \
#define ROUNDS(x) {unsigned int rcnt; \
for (rcnt = 0; rcnt< x*1000; rcnt++) { \
for (rcnt = 0; rcnt < x*1000; rcnt++) { \
(void)(((int)(pow(rcnt, rcnt) * sqrt(rcnt*7230970)) ^ 7230716) ^ (int)atan2(rcnt, rcnt)); \
(void)(((int)(pow(rcnt, rcnt) * \
}} \
sqrt(rcnt*7230970)) ^ 7230716) ^ \
(int)atan2(rcnt, rcnt)); \
} } \
void
start_benchmark
(
struct
config
*
config
);
void
start_benchmark
(
struct
config
*
config
);
tools/power/cpupower/bench/config.h
浏览文件 @
02af3cb5
...
@@ -31,6 +31,6 @@
...
@@ -31,6 +31,6 @@
#ifdef DEBUG
#ifdef DEBUG
#define dprintf printf
#define dprintf printf
#else
#else
#define dprintf(
... ) while(0) { }
#define dprintf(
...) do { } while (0)
#endif
#endif
tools/power/cpupower/bench/main.c
浏览文件 @
02af3cb5
...
@@ -28,8 +28,7 @@
...
@@ -28,8 +28,7 @@
#include "system.h"
#include "system.h"
#include "benchmark.h"
#include "benchmark.h"
static
struct
option
long_options
[]
=
static
struct
option
long_options
[]
=
{
{
{
"output"
,
1
,
0
,
'o'
},
{
"output"
,
1
,
0
,
'o'
},
{
"sleep"
,
1
,
0
,
's'
},
{
"sleep"
,
1
,
0
,
's'
},
{
"load"
,
1
,
0
,
'l'
},
{
"load"
,
1
,
0
,
'l'
},
...
@@ -50,7 +49,7 @@ static struct option long_options[] =
...
@@ -50,7 +49,7 @@ static struct option long_options[] =
usage
usage
*******************************************************************/
*******************************************************************/
void
usage
()
void
usage
()
{
{
printf
(
"usage: ./bench
\n
"
);
printf
(
"usage: ./bench
\n
"
);
printf
(
"Options:
\n
"
);
printf
(
"Options:
\n
"
);
...
@@ -67,7 +66,7 @@ void usage()
...
@@ -67,7 +66,7 @@ void usage()
printf
(
" -o, --output=<dir>
\t\t\t
output path. Filename will be OUTPUTPATH/benchmark_TIMESTAMP.log
\n
"
);
printf
(
" -o, --output=<dir>
\t\t\t
output path. Filename will be OUTPUTPATH/benchmark_TIMESTAMP.log
\n
"
);
printf
(
" -v, --verbose
\t\t\t\t
verbose output on/off
\n
"
);
printf
(
" -v, --verbose
\t\t\t\t
verbose output on/off
\n
"
);
printf
(
" -h, --help
\t\t\t\t
Print this help screen
\n
"
);
printf
(
" -h, --help
\t\t\t\t
Print this help screen
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
/*******************************************************************
/*******************************************************************
...
...
tools/power/cpupower/bench/parse.c
浏览文件 @
02af3cb5
...
@@ -86,20 +86,22 @@ FILE *prepare_output(const char *dirname)
...
@@ -86,20 +86,22 @@ FILE *prepare_output(const char *dirname)
len
+=
strlen
(
sysdata
.
nodename
)
+
strlen
(
sysdata
.
release
);
len
+=
strlen
(
sysdata
.
nodename
)
+
strlen
(
sysdata
.
release
);
filename
=
realloc
(
filename
,
sizeof
(
char
)
*
len
);
filename
=
realloc
(
filename
,
sizeof
(
char
)
*
len
);
if
(
filename
==
NULL
)
{
if
(
filename
==
NULL
)
{
perror
(
"realloc"
);
perror
(
"realloc"
);
return
NULL
;
return
NULL
;
}
}
snprintf
(
filename
,
len
-
1
,
"%s/benchmark_%s_%s_%li.log"
,
snprintf
(
filename
,
len
-
1
,
"%s/benchmark_%s_%s_%li.log"
,
dirname
,
sysdata
.
nodename
,
sysdata
.
release
,
time
(
NULL
));
dirname
,
sysdata
.
nodename
,
sysdata
.
release
,
time
(
NULL
));
}
else
{
}
else
{
snprintf
(
filename
,
len
-
1
,
"%s/benchmark_%li.log"
,
dirname
,
time
(
NULL
));
snprintf
(
filename
,
len
-
1
,
"%s/benchmark_%li.log"
,
dirname
,
time
(
NULL
));
}
}
dprintf
(
"logilename: %s
\n
"
,
filename
);
dprintf
(
"logilename: %s
\n
"
,
filename
);
if
((
output
=
fopen
(
filename
,
"w+"
))
==
NULL
)
{
output
=
fopen
(
filename
,
"w+"
);
if
(
output
==
NULL
)
{
perror
(
"fopen"
);
perror
(
"fopen"
);
fprintf
(
stderr
,
"error: unable to open logfile
\n
"
);
fprintf
(
stderr
,
"error: unable to open logfile
\n
"
);
}
}
...
@@ -130,7 +132,7 @@ struct config *prepare_default_config()
...
@@ -130,7 +132,7 @@ struct config *prepare_default_config()
config
->
load_step
=
500000
;
config
->
load_step
=
500000
;
config
->
cycles
=
5
;
config
->
cycles
=
5
;
config
->
rounds
=
50
;
config
->
rounds
=
50
;
config
->
cpu
=
0
;
config
->
cpu
=
0
;
config
->
prio
=
SCHED_HIGH
;
config
->
prio
=
SCHED_HIGH
;
config
->
verbose
=
0
;
config
->
verbose
=
0
;
strncpy
(
config
->
governor
,
"ondemand"
,
8
);
strncpy
(
config
->
governor
,
"ondemand"
,
8
);
...
@@ -166,13 +168,12 @@ int prepare_config(const char *path, struct config *config)
...
@@ -166,13 +168,12 @@ int prepare_config(const char *path, struct config *config)
if
(
configfile
==
NULL
)
{
if
(
configfile
==
NULL
)
{
perror
(
"fopen"
);
perror
(
"fopen"
);
fprintf
(
stderr
,
"error: unable to read configfile
\n
"
);
fprintf
(
stderr
,
"error: unable to read configfile
\n
"
);
free
(
config
);
free
(
config
);
return
1
;
return
1
;
}
}
while
(
getline
(
&
line
,
&
len
,
configfile
)
!=
-
1
)
while
(
getline
(
&
line
,
&
len
,
configfile
)
!=
-
1
)
{
{
if
(
line
[
0
]
==
'#'
||
line
[
0
]
==
' '
)
if
(
line
[
0
]
==
'#'
||
line
[
0
]
==
' '
)
continue
;
continue
;
...
@@ -183,35 +184,35 @@ int prepare_config(const char *path, struct config *config)
...
@@ -183,35 +184,35 @@ int prepare_config(const char *path, struct config *config)
if
(
strncmp
(
"sleep"
,
opt
,
strlen
(
opt
))
==
0
)
if
(
strncmp
(
"sleep"
,
opt
,
strlen
(
opt
))
==
0
)
sscanf
(
val
,
"%li"
,
&
config
->
sleep
);
sscanf
(
val
,
"%li"
,
&
config
->
sleep
);
else
if
(
strncmp
(
"load"
,
opt
,
strlen
(
opt
))
==
0
)
else
if
(
strncmp
(
"load"
,
opt
,
strlen
(
opt
))
==
0
)
sscanf
(
val
,
"%li"
,
&
config
->
load
);
sscanf
(
val
,
"%li"
,
&
config
->
load
);
else
if
(
strncmp
(
"load_step"
,
opt
,
strlen
(
opt
))
==
0
)
else
if
(
strncmp
(
"load_step"
,
opt
,
strlen
(
opt
))
==
0
)
sscanf
(
val
,
"%li"
,
&
config
->
load_step
);
sscanf
(
val
,
"%li"
,
&
config
->
load_step
);
else
if
(
strncmp
(
"sleep_step"
,
opt
,
strlen
(
opt
))
==
0
)
else
if
(
strncmp
(
"sleep_step"
,
opt
,
strlen
(
opt
))
==
0
)
sscanf
(
val
,
"%li"
,
&
config
->
sleep_step
);
sscanf
(
val
,
"%li"
,
&
config
->
sleep_step
);
else
if
(
strncmp
(
"cycles"
,
opt
,
strlen
(
opt
))
==
0
)
else
if
(
strncmp
(
"cycles"
,
opt
,
strlen
(
opt
))
==
0
)
sscanf
(
val
,
"%u"
,
&
config
->
cycles
);
sscanf
(
val
,
"%u"
,
&
config
->
cycles
);
else
if
(
strncmp
(
"rounds"
,
opt
,
strlen
(
opt
))
==
0
)
else
if
(
strncmp
(
"rounds"
,
opt
,
strlen
(
opt
))
==
0
)
sscanf
(
val
,
"%u"
,
&
config
->
rounds
);
sscanf
(
val
,
"%u"
,
&
config
->
rounds
);
else
if
(
strncmp
(
"verbose"
,
opt
,
strlen
(
opt
))
==
0
)
else
if
(
strncmp
(
"verbose"
,
opt
,
strlen
(
opt
))
==
0
)
sscanf
(
val
,
"%u"
,
&
config
->
verbose
);
sscanf
(
val
,
"%u"
,
&
config
->
verbose
);
else
if
(
strncmp
(
"output"
,
opt
,
strlen
(
opt
))
==
0
)
else
if
(
strncmp
(
"output"
,
opt
,
strlen
(
opt
))
==
0
)
config
->
output
=
prepare_output
(
val
);
config
->
output
=
prepare_output
(
val
);
else
if
(
strncmp
(
"cpu"
,
opt
,
strlen
(
opt
))
==
0
)
else
if
(
strncmp
(
"cpu"
,
opt
,
strlen
(
opt
))
==
0
)
sscanf
(
val
,
"%u"
,
&
config
->
cpu
);
sscanf
(
val
,
"%u"
,
&
config
->
cpu
);
else
if
(
strncmp
(
"governor"
,
opt
,
14
)
==
0
)
else
if
(
strncmp
(
"governor"
,
opt
,
14
)
==
0
)
strncpy
(
config
->
governor
,
val
,
14
);
strncpy
(
config
->
governor
,
val
,
14
);
else
if
(
strncmp
(
"priority"
,
opt
,
strlen
(
opt
))
==
0
)
{
else
if
(
strncmp
(
"priority"
,
opt
,
strlen
(
opt
))
==
0
)
{
if
(
string_to_prio
(
val
)
!=
SCHED_ERR
)
if
(
string_to_prio
(
val
)
!=
SCHED_ERR
)
config
->
prio
=
string_to_prio
(
val
);
config
->
prio
=
string_to_prio
(
val
);
}
}
}
}
...
...
tools/power/cpupower/bench/parse.h
浏览文件 @
02af3cb5
...
@@ -20,19 +20,22 @@
...
@@ -20,19 +20,22 @@
/* struct that holds the required config parameters */
/* struct that holds the required config parameters */
struct
config
struct
config
{
{
long
sleep
;
/* sleep time in µs */
long
sleep
;
/* sleep time in
µ
s */
long
load
;
/* load time in µs */
long
load
;
/* load time in
µ
s */
long
sleep_step
;
/* time value which changes the
long
sleep_step
;
/* time value which changes the
* sleep time after every round in µs */
* sleep time after every round in
µ
s */
long
load_step
;
/* time value which changes the
long
load_step
;
/* time value which changes the
* load time after every round in µs */
* load time after every round in
µ
s */
unsigned
int
cycles
;
/* calculation cycles with the same sleep/load time */
unsigned
int
cycles
;
/* calculation cycles with the same sleep/load time */
unsigned
int
rounds
;
/* calculation rounds with iterated sleep/load time */
unsigned
int
rounds
;
/* calculation rounds with iterated sleep/load time */
unsigned
int
cpu
;
/* cpu for which the affinity is set */
unsigned
int
cpu
;
/* cpu for which the affinity is set */
char
governor
[
15
];
/* cpufreq governor */
char
governor
[
15
];
/* cpufreq governor */
enum
sched_prio
/* possible scheduler priorities */
enum
sched_prio
/* possible scheduler priorities */
{
{
SCHED_ERR
=-
1
,
SCHED_HIGH
,
SCHED_DEFAULT
,
SCHED_LOW
SCHED_ERR
=
-
1
,
SCHED_HIGH
,
SCHED_DEFAULT
,
SCHED_LOW
}
prio
;
}
prio
;
unsigned
int
verbose
;
/* verbose output */
unsigned
int
verbose
;
/* verbose output */
...
...
tools/power/cpupower/bench/system.c
浏览文件 @
02af3cb5
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
#include "system.h"
#include "system.h"
/**
/**
* returns time since epoch in s
* returns time since epoch in
µ
s
*
*
* @retval time
* @retval time
**/
**/
...
@@ -87,7 +87,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu)
...
@@ -87,7 +87,7 @@ int set_cpufreq_governor(char *governor, unsigned int cpu)
int
set_cpu_affinity
(
unsigned
int
cpu
)
int
set_cpu_affinity
(
unsigned
int
cpu
)
{
{
cpu_set_t
cpuset
;
cpu_set_t
cpuset
;
CPU_ZERO
(
&
cpuset
);
CPU_ZERO
(
&
cpuset
);
CPU_SET
(
cpu
,
&
cpuset
);
CPU_SET
(
cpu
,
&
cpuset
);
...
@@ -129,7 +129,7 @@ int set_process_priority(int priority)
...
@@ -129,7 +129,7 @@ int set_process_priority(int priority)
}
}
/**
/**
* notif
ys the user that the benchmark may run some time
* notif
ies the user that the benchmark may run some time
*
*
* @param config benchmark config values
* @param config benchmark config values
*
*
...
@@ -142,8 +142,11 @@ void prepare_user(const struct config *config)
...
@@ -142,8 +142,11 @@ void prepare_user(const struct config *config)
unsigned
int
round
;
unsigned
int
round
;
for
(
round
=
0
;
round
<
config
->
rounds
;
round
++
)
{
for
(
round
=
0
;
round
<
config
->
rounds
;
round
++
)
{
sleep_time
+=
2
*
config
->
cycles
*
(
config
->
sleep
+
config
->
sleep_step
*
round
);
sleep_time
+=
2
*
config
->
cycles
*
load_time
+=
2
*
config
->
cycles
*
(
config
->
load
+
config
->
load_step
*
round
)
+
(
config
->
load
+
config
->
load_step
*
round
*
4
);
(
config
->
sleep
+
config
->
sleep_step
*
round
);
load_time
+=
2
*
config
->
cycles
*
(
config
->
load
+
config
->
load_step
*
round
)
+
(
config
->
load
+
config
->
load_step
*
round
*
4
);
}
}
if
(
config
->
verbose
||
config
->
output
!=
stdout
)
if
(
config
->
verbose
||
config
->
output
!=
stdout
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录