Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
9275cbb6
提交
9275cbb6
3月 21, 2012
创建
作者:
Austin Clements
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
asharing: Utilities to manage abstract sharing scopes and objects
上级
7de00a22
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
57 行增加
和
0 行删除
+57
-0
kmtrace.hh
include/kmtrace.hh
+57
-0
没有找到文件。
include/kmtrace.hh
浏览文件 @
9275cbb6
#pragma once
#include "mtrace.h"
#include "mtrace.h"
#if MTRACE
#if MTRACE
// Tell mtrace about switching threads
// Tell mtrace about switching threads
struct
kstack_tag
{
struct
kstack_tag
{
...
@@ -61,6 +64,51 @@ static inline void mtresume(struct proc *p)
...
@@ -61,6 +64,51 @@ static inline void mtresume(struct proc *p)
#define mtrec() mtrace_call_set(1, ~0ull)
#define mtrec() mtrace_call_set(1, ~0ull)
#define mtign() mtrace_call_set(0, ~0ull)
#define mtign() mtrace_call_set(0, ~0ull)
class
mt_ascope
{
char
name
[
32
];
public
:
explicit
mt_ascope
(
const
char
*
fmt
,
...)
{
va_list
ap
;
va_start
(
ap
,
fmt
);
vsnprintf
(
name
,
sizeof
(
name
)
-
1
,
fmt
,
ap
);
va_end
(
ap
);
mtrace_ascope_register
(
0
,
name
);
}
~
mt_ascope
()
{
mtrace_ascope_register
(
1
,
name
);
}
};
static
inline
void
mtreadavar
(
const
char
*
fmt
,
...)
{
char
name
[
32
];
va_list
ap
;
va_start
(
ap
,
fmt
);
vsnprintf
(
name
,
sizeof
(
name
),
fmt
,
ap
);
va_end
(
ap
);
mtrace_avar_register
(
0
,
name
);
}
static
inline
void
mtwriteavar
(
const
char
*
fmt
,
...)
{
char
name
[
32
];
va_list
ap
;
va_start
(
ap
,
fmt
);
vsnprintf
(
name
,
sizeof
(
name
),
fmt
,
ap
);
va_end
(
ap
);
mtrace_avar_register
(
1
,
name
);
}
#else
#else
#define mtstart(ip, p) do { } while (0)
#define mtstart(ip, p) do { } while (0)
#define mtstop(p) do { } while (0)
#define mtstop(p) do { } while (0)
...
@@ -70,4 +118,13 @@ static inline void mtresume(struct proc *p)
...
@@ -70,4 +118,13 @@ static inline void mtresume(struct proc *p)
#define mtign(cpu) do { } while (0)
#define mtign(cpu) do { } while (0)
#define mtrec(cpu) do { } while (0)
#define mtrec(cpu) do { } while (0)
#define mtign(cpu) do { } while (0)
#define mtign(cpu) do { } while (0)
class
mt_ascope
{
public
:
explicit
mt_ascope
(
const
char
*
fmt
,
...)
{}
};
#define mtreadavar(fmt, ...) do { } while (0)
#define mtwriteavar(fmt, ...) do { } while (0)
#endif
#endif
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论