Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
d0e7f560
提交
d0e7f560
4月 28, 2012
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Tweaks to bench
上级
8faab0a2
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
16 行增加
和
14 行删除
+16
-14
bench.cc
bin/bench.cc
+16
-14
没有找到文件。
bin/bench.cc
浏览文件 @
d0e7f560
...
@@ -62,34 +62,30 @@ struct TimedExec : public Bench
...
@@ -62,34 +62,30 @@ struct TimedExec : public Bench
NEW_OPERATOR
(
TimedExec
)
NEW_OPERATOR
(
TimedExec
)
};
};
struct
Dirb
ench
:
public
Bench
struct
LoopsB
ench
:
public
Bench
{
{
Dirbench
()
:
Bench
()
{}
LoopsBench
(
const
char
*
cmd
,
int
nloops
,
int
cpuinc
)
:
Bench
(),
cmd_
(
cmd
),
nloops_
(
nloops
),
cpuinc_
(
cpuinc
)
{}
virtual
void
run
(
void
)
{
virtual
void
run
(
void
)
{
#ifdef HW_qemu
int
nloop
=
50
;
#else
int
nloop
=
1000
;
#endif
char
nloopstr
[
16
];
char
nloopstr
[
16
];
snprintf
(
nloopstr
,
sizeof
(
nloopstr
),
"%u"
,
nloop
);
snprintf
(
nloopstr
,
sizeof
(
nloopstr
),
"%u"
,
nloops_
);
const
char
*
argv
[]
=
{
cmd_
,
0
,
nloopstr
,
0
};
const
char
*
argv
[]
=
{
"/dirbench"
,
0
,
nloopstr
,
0
};
char
*
res
=
result_
;
char
*
res
=
result_
;
char
*
q
=
res
+
sizeof
(
result_
);
char
*
q
=
res
+
sizeof
(
result_
);
snprintf
(
res
,
q
-
res
,
"#cores usecs loops/core
\n
"
);
snprintf
(
res
,
q
-
res
,
"#cores usecs loops/core
\n
"
);
res
+=
strlen
(
res
);
res
+=
strlen
(
res
);
for
(
int
i
=
6
;
i
<=
NCPU
;
i
+=
6
)
{
for
(
int
i
=
cpuinc_
;
i
<=
NCPU
;
i
+=
cpuinc_
)
{
char
cores
[
16
];
char
cores
[
16
];
snprintf
(
cores
,
sizeof
(
cores
),
"%u"
,
i
);
snprintf
(
cores
,
sizeof
(
cores
),
"%u"
,
i
);
argv
[
1
]
=
cores
;
argv
[
1
]
=
cores
;
u64
r
=
time_this
(
argv
);
u64
r
=
time_this
(
argv
);
// r in usecs
// r in usecs
r
=
(
r
*
(
1000
*
1000
))
/
cpuhz
();
r
=
(
r
*
(
1000
*
1000
))
/
cpuhz
();
snprintf
(
res
,
q
-
res
,
"%u %lu %lu
\n
"
,
i
,
r
,
nloop
);
snprintf
(
res
,
q
-
res
,
"%u %lu %lu
\n
"
,
i
,
r
,
nloop
s_
);
res
+=
strlen
(
res
);
res
+=
strlen
(
res
);
}
}
}
}
...
@@ -98,9 +94,11 @@ struct Dirbench : public Bench
...
@@ -98,9 +94,11 @@ struct Dirbench : public Bench
return
result_
;
return
result_
;
}
}
const
char
*
cmd_
;
int
nloops_
;
int
cpuinc_
;
char
result_
[
1024
];
char
result_
[
1024
];
NEW_OPERATOR
(
LoopsBench
)
NEW_OPERATOR
(
Dirbench
)
};
};
#define CMD(...) new TimedExec((const char *[]){__VA_ARGS__, 0})
#define CMD(...) new TimedExec((const char *[]){__VA_ARGS__, 0})
...
@@ -113,7 +111,11 @@ main(int ac, char **av)
...
@@ -113,7 +111,11 @@ main(int ac, char **av)
static
Bench
*
the_bench
[
128
];
static
Bench
*
the_bench
[
128
];
int
n
=
0
;
int
n
=
0
;
the_bench
[
n
++
]
=
new
Dirbench
();
//the_bench[n++] = new LoopsBench("/dirbench", 1000, 6);
the_bench
[
n
++
]
=
new
LoopsBench
(
"/filebench"
,
100000
,
6
);
//the_bench[n++] = CMD("filebench", "6", "10000");
//the_bench[n++] = CMD("filebench", "48", "10000");
//the_bench[n++] = CMD("forkexecbench");
//the_bench[n++] = CMD("forkexecbench");
//the_bench[n++] = CMD("mktree", STR(NCPU), "tree.xdu", "4", "4");
//the_bench[n++] = CMD("mktree", STR(NCPU), "tree.xdu", "4", "4");
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论