Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
8286b580
提交
8286b580
5月 03, 2012
创建
作者:
Austin Clements
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove my lame start sync and start recording before setup
Turns out mscan deals just fine with the benchmark setup
上级
a036c823
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
13 行增加
和
30 行删除
+13
-30
dirbench.cc
bin/dirbench.cc
+7
-14
filebench.cc
bin/filebench.cc
+2
-14
mapbench.cc
bin/mapbench.cc
+4
-2
没有找到文件。
bin/dirbench.cc
浏览文件 @
8286b580
...
...
@@ -22,10 +22,15 @@ static const bool pinit = true;
enum
{
nfile
=
MTRACE
?
2
:
10
};
enum
{
nlookup
=
MTRACE
?
2
:
100
};
// XXX(austin) Totally lame. Put this buffer in the BSS so we don't
// have to COW fault the stack.
static
char
pn
[
32
]
__attribute__
((
aligned
(
4096
)));
void
bench
(
u32
tid
,
int
nloop
,
const
char
*
path
)
{
char
pn
[
32
];
//
char pn[32];
if
(
pinit
)
setaffinity
(
tid
);
...
...
@@ -85,29 +90,17 @@ main(int ac, char** av)
xmkdir
(
path
);
int
start
[
2
];
if
(
pipe
(
start
)
<
0
)
die
(
"pipe"
);
mtenable_type
(
mtrace_record_ascope
,
"xv6-dirbench"
);
u64
t0
=
rdtsc
();
for
(
u32
i
=
0
;
i
<
nthread
;
i
++
)
{
int
pid
=
xfork
();
if
(
pid
==
0
)
{
close
(
start
[
1
]);
char
token
;
if
(
read
(
start
[
0
],
&
token
,
1
)
<
1
)
die
(
"read"
);
bench
(
i
,
nloop
,
path
);
}
else
if
(
pid
<
0
)
die
(
"fork"
);
}
mtenable_type
(
mtrace_record_ascope
,
"xv6-dirbench"
);
const
char
wakeup
[
256
]
=
{};
if
(
write
(
start
[
1
],
wakeup
,
nthread
)
<
nthread
)
die
(
"write"
);
for
(
u32
i
=
0
;
i
<
nthread
;
i
++
)
xwait
();
u64
t1
=
rdtsc
();
...
...
bin/filebench.cc
浏览文件 @
8286b580
...
...
@@ -74,6 +74,8 @@ main(int ac, char **av)
if
(
ac
>
3
)
path
=
av
[
3
];
mtenable_type
(
mtrace_record_ascope
,
"xv6-filebench"
);
// Setup shared file
unlink
(
path
);
int
fd
=
xcreat
(
path
);
...
...
@@ -86,31 +88,17 @@ main(int ac, char **av)
}
close
(
fd
);
int
start
[
2
];
if
(
pipe
(
start
)
<
0
)
die
(
"pipe"
);
//mtenable("xv6-filebench");
u64
t0
=
rdtsc
();
for
(
int
i
=
0
;
i
<
nthread
;
i
++
)
{
int
pid
=
xfork
();
if
(
pid
==
0
)
{
close
(
start
[
1
]);
char
token
;
if
(
read
(
start
[
0
],
&
token
,
1
)
<
1
)
die
(
"read"
);
bench
(
i
,
nloop
,
path
);
}
else
if
(
pid
<
0
)
die
(
"fork"
);
}
mtenable_type
(
mtrace_record_ascope
,
"xv6-filebench"
);
const
char
wakeup
[
256
]
=
{};
if
(
write
(
start
[
1
],
wakeup
,
nthread
)
<
nthread
)
die
(
"write"
);
for
(
int
i
=
0
;
i
<
nthread
;
i
++
)
xwait
();
u64
t1
=
rdtsc
();
...
...
bin/mapbench.cc
浏览文件 @
8286b580
...
...
@@ -37,8 +37,8 @@ thr(void *arg)
pthread_barrier_wait
(
&
bar
);
if
(
tid
==
0
)
mtenable_type
(
mtrace_record_ascope
,
"xv6-asharing"
);
//
if (tid == 0)
//
mtenable_type(mtrace_record_ascope, "xv6-asharing");
pthread_barrier_wait
(
&
bar2
);
...
...
@@ -75,6 +75,8 @@ main(int ac, char **av)
if
(
ac
>
2
)
niter
=
atoi
(
av
[
2
]);
mtenable_type
(
mtrace_record_ascope
,
"xv6-asharing"
);
pthread_t
*
tid
=
(
pthread_t
*
)
malloc
(
sizeof
(
*
tid
)
*
nthread
);
pthread_barrier_init
(
&
bar
,
0
,
nthread
);
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论