Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
6de329b7
提交
6de329b7
3月 01, 2012
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove obsolete profiling code
上级
a7d6a3f6
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
0 行增加
和
106 行删除
+0
-106
README
README
+0
-1
kernel.hh
include/kernel.hh
+0
-5
prof.hh
include/prof.hh
+0
-32
Makefrag
kernel/Makefrag
+0
-1
console.cc
kernel/console.cc
+0
-12
exec.cc
kernel/exec.cc
+0
-10
prof.cc
kernel/prof.cc
+0
-45
没有找到文件。
README
浏览文件 @
6de329b7
...
...
@@ -56,4 +56,3 @@
$ apt-get install libjemalloc-dev
$ make HW=user o.user/utest
include/kernel.hh
浏览文件 @
6de329b7
...
...
@@ -194,11 +194,6 @@ void yield(void);
struct
proc
*
threadalloc
(
void
(
*
fn
)(
void
*
),
void
*
arg
);
struct
proc
*
threadpin
(
void
(
*
fn
)(
void
*
),
void
*
arg
,
const
char
*
name
,
int
cpu
);
// prof.c
extern
int
profenable
;
void
profreset
(
void
);
void
profdump
(
void
);
// sampler.c
void
sampstart
(
void
);
int
sampintr
(
struct
trapframe
*
);
...
...
include/prof.hh
deleted
100644 → 0
浏览文件 @
a7d6a3f6
struct
profrec
{
u64
tot
;
u64
cnt
;
__padout__
;
}
__mpalign__
;
typedef
struct
profctr
{
const
char
*
name
;
struct
profrec
rec
[
NCPU
]
__mpalign__
;
__padout__
;
}
profctr_t
;
#if 0 /* not for c++ */
#define DEFINE_PROFCTR(xname) \
profctr_t xname __attribute__((section(".prof"))) = { .name = #xname };
#define prof_start(name) \
u64 __prof##name = profenable ? rdtsc() : 0;
#define prof_end(name) do { \
if (profenable) { \
u64 __eprof##name = rdtsc(); \
u64 __profid = mycpu()->id; \
name.rec[__profid].tot += __eprof##name - __prof##name; \
name.rec[__profid].cnt++; \
} \
} while (0)
#else
#define DEFINE_PROFCTR(x)
#define prof_start(x)
#define prof_end(x)
#endif
kernel/Makefrag
浏览文件 @
6de329b7
...
...
@@ -29,7 +29,6 @@ OBJS = \
picirq.o \
pipe.o \
proc.o \
prof.o \
gc.o \
rnd.o \
sampler.o \
...
...
kernel/console.cc
浏览文件 @
6de329b7
...
...
@@ -270,18 +270,6 @@ consoleintr(int (*getc)(void))
case
C
(
'W'
):
wq_dump
();
break
;
case
C
(
'L'
):
// Prof stats
profdump
();
break
;
case
C
(
'K'
):
// Prof enable
profreset
();
cprintf
(
"prof enabled
\n
"
);
profenable
=
1
;
break
;
case
C
(
'I'
):
// Prof disable
profenable
=
0
;
cprintf
(
"prof disabled
\n
"
);
break
;
case
C
(
'F'
):
// kmem stats
kmemprint
();
break
;
...
...
kernel/exec.cc
浏览文件 @
6de329b7
...
...
@@ -12,7 +12,6 @@
#include "vm.hh"
#include "elf.hh"
#include "cpu.hh"
#include "prof.hh"
#include "wq.hh"
#include "cilk.hh"
...
...
@@ -39,7 +38,6 @@ dosegment(struct eargs *args, u64 off)
uptr
in_sz
;
int
npg
;
prof_start
(
dosegment_prof
);
if
(
readi
(
args
->
ip
,
(
char
*
)
&
ph
,
off
,
sizeof
(
ph
))
!=
sizeof
(
ph
))
goto
bad
;
if
(
ph
.
type
!=
ELF_PROG_LOAD
)
...
...
@@ -62,7 +60,6 @@ dosegment(struct eargs *args, u64 off)
if
(
args
->
vmap
->
insert
(
vmn
,
va_start
,
1
)
<
0
)
goto
bad
;
prof_end
(
dosegment_prof
);
return
;
bad:
...
...
@@ -78,7 +75,6 @@ dostack(struct eargs *args)
uptr
ustack
[
1
+
MAXARG
+
1
];
const
char
*
s
,
*
last
;
prof_start
(
dostack_prof
);
// Allocate a one-page stack at the top of the (user) address space
if
((
vmn
=
new
vmnode
(
USTACKPAGES
))
==
0
)
goto
bad
;
...
...
@@ -98,7 +94,6 @@ dostack(struct eargs *args)
}
ustack
[
1
+
argc
]
=
0
;
//prof_start(exec3_prof);
ustack
[
0
]
=
0xffffffffffffffffull
;
// fake return PC
args
->
proc
->
tf
->
rdi
=
argc
;
args
->
proc
->
tf
->
rsi
=
sp
-
(
argc
+
1
)
*
8
;
...
...
@@ -116,7 +111,6 @@ dostack(struct eargs *args)
safestrcpy
(
args
->
proc
->
name
,
last
,
sizeof
(
args
->
proc
->
name
));
args
->
proc
->
tf
->
rsp
=
sp
;
prof_end
(
dostack_prof
);
return
;
bad:
...
...
@@ -128,14 +122,12 @@ doheap(struct eargs *args)
{
struct
vmnode
*
vmn
=
nullptr
;
prof_start
(
doheap_prof
);
// Allocate a vmnode for the heap.
// XXX pre-allocate 32 pages..
if
((
vmn
=
new
vmnode
(
32
))
==
0
)
goto
bad
;
if
(
args
->
vmap
->
insert
(
vmn
,
BRK
,
1
)
<
0
)
goto
bad
;
prof_end
(
doheap_prof
);
return
;
...
...
@@ -154,7 +146,6 @@ exec(const char *path, char **argv)
int
i
;
struct
vmap
*
oldvmap
;
prof_start
(
exec_prof
);
if
((
ip
=
namei
(
myproc
()
->
cwd
,
path
))
==
0
)
return
-
1
;
...
...
@@ -218,7 +209,6 @@ exec(const char *path, char **argv)
oldvmap
->
decref
();
gc_end_epoch
();
prof_end
(
exec_prof
);
return
0
;
bad:
...
...
kernel/prof.cc
deleted
100644 → 0
浏览文件 @
a7d6a3f6
#include "types.h"
#include "kernel.hh"
#include "spinlock.h"
#include "condvar.h"
#include "fs.h"
#include "file.hh"
#include "prof.hh"
#include "bits.hh"
#include "amd64.h"
extern
profctr_t
sprof
[];
extern
profctr_t
eprof
[];
int
profenable
;
void
profreset
(
void
)
{
profctr_t
*
p
=
sprof
;
for
(;
p
!=
eprof
;
p
++
)
{
memset
(
p
->
rec
,
0
,
sizeof
(
p
->
rec
));
}
}
static
void
profsum
(
struct
profctr
*
ctr
,
u64
*
tot
,
u64
*
cnt
)
{
for
(
int
i
=
0
;
i
<
NCPU
;
i
++
)
{
*
tot
+=
ctr
->
rec
[
i
].
tot
;
*
cnt
+=
ctr
->
rec
[
i
].
cnt
;
}
}
void
profdump
(
void
)
{
profctr_t
*
p
=
sprof
;
for
(;
p
!=
eprof
;
p
++
)
{
u64
tot
=
0
,
cnt
=
0
;
profsum
(
p
,
&
tot
,
&
cnt
);
if
(
cnt
)
cprintf
(
"%s %lu
\n
"
,
p
->
name
,
tot
/
cnt
);
}
sampdump
();
}
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论