Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
a8abd2eb
提交
a8abd2eb
3月 22, 2012
创建
作者:
Austin Clements
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use ascope record mode to record all unique accesses in each ascope
上级
2bd97a93
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
4 行增加
和
4 行删除
+4
-4
asharing.cc
bin/asharing.cc
+2
-4
mtrace.h
include/mtrace.h
+2
-0
没有找到文件。
bin/asharing.cc
浏览文件 @
a8abd2eb
...
@@ -52,17 +52,13 @@ fssharing(void* arg)
...
@@ -52,17 +52,13 @@ fssharing(void* arg)
char
filename
[
32
];
char
filename
[
32
];
snprintf
(
filename
,
sizeof
(
filename
),
"f%d"
,
i
);
snprintf
(
filename
,
sizeof
(
filename
),
"f%d"
,
i
);
mtenable
(
"xv6-fssharing"
);
open
(
filename
,
O_CREATE
|
O_RDWR
);
open
(
filename
,
O_CREATE
|
O_RDWR
);
mtdisable
(
"xv6-fssharing"
);
pthread_barrier_wait
(
&
bar
);
pthread_barrier_wait
(
&
bar
);
for
(
u64
j
=
0
;
j
<
ncore
;
j
++
)
{
for
(
u64
j
=
0
;
j
<
ncore
;
j
++
)
{
snprintf
(
filename
,
sizeof
(
filename
),
"f%d"
,
j
);
snprintf
(
filename
,
sizeof
(
filename
),
"f%d"
,
j
);
mtenable
(
"xv6-fssharing"
);
open
(
filename
,
O_RDWR
);
open
(
filename
,
O_RDWR
);
mtdisable
(
"xv6-fssharing"
);
}
}
return
0
;
return
0
;
}
}
...
@@ -79,11 +75,13 @@ main(int ac, char **av)
...
@@ -79,11 +75,13 @@ main(int ac, char **av)
fprintf
(
1
,
"usage: %s vm|fs
\n
"
,
av
[
0
]);
fprintf
(
1
,
"usage: %s vm|fs
\n
"
,
av
[
0
]);
if
(
op
)
{
if
(
op
)
{
mtenable_type
(
mtrace_record_ascope
,
"xv6-asharing"
);
pthread_barrier_init
(
&
bar
,
0
,
ncore
);
pthread_barrier_init
(
&
bar
,
0
,
ncore
);
for
(
u64
i
=
0
;
i
<
ncore
;
i
++
)
{
for
(
u64
i
=
0
;
i
<
ncore
;
i
++
)
{
next
();
next
();
pthread_t
tid
;
pthread_t
tid
;
pthread_create
(
&
tid
,
0
,
op
,
(
void
*
)
i
);
pthread_create
(
&
tid
,
0
,
op
,
(
void
*
)
i
);
}
}
mtdisable
(
"xv6-asharing"
);
}
}
}
}
include/mtrace.h
浏览文件 @
a8abd2eb
...
@@ -34,6 +34,7 @@ char* strncpy(char *s, const char *t, size_t n);
...
@@ -34,6 +34,7 @@ char* strncpy(char *s, const char *t, size_t n);
// Enable/disable all mtrace logging
// Enable/disable all mtrace logging
#define mtenable(name) mtrace_enable_set(mtrace_record_movement, name)
#define mtenable(name) mtrace_enable_set(mtrace_record_movement, name)
#define mtenable_type(type, name) mtrace_enable_set(type, name)
#define mtdisable(name) mtrace_enable_set(mtrace_record_disable, name)
#define mtdisable(name) mtrace_enable_set(mtrace_record_disable, name)
// Log the number of operations
// Log the number of operations
...
@@ -54,6 +55,7 @@ static inline void mtops(u64 n)
...
@@ -54,6 +55,7 @@ static inline void mtops(u64 n)
#define mtrec(cpu) do { } while (0)
#define mtrec(cpu) do { } while (0)
#define mtign(cpu) do { } while (0)
#define mtign(cpu) do { } while (0)
#define mtenable(name) do { } while (0)
#define mtenable(name) do { } while (0)
#define mtenable_type(type, name) do { } while (0)
#define mtdisable(name) do { } while (0)
#define mtdisable(name) do { } while (0)
#define mtops(n) do { } while (0)
#define mtops(n) do { } while (0)
#endif
#endif
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论