Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
X
xv6-public
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
问题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
银宸时代
OS Lab Group
奖励实验
xv6-public
提交
561179c4
提交
561179c4
12月 04, 2011
创建
作者:
Silas Boyd-Wickizer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
An IPI to configure event counters.
上级
5606f832
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
27 行增加
和
3 行删除
+27
-3
kernel.h
kernel.h
+2
-0
lapic.c
lapic.c
+6
-0
sampler.c
sampler.c
+14
-1
trap.c
trap.c
+4
-2
traps.h
traps.h
+1
-0
没有找到文件。
kernel.h
浏览文件 @
561179c4
...
@@ -130,6 +130,7 @@ int cpunum(void);
...
@@ -130,6 +130,7 @@ int cpunum(void);
void
lapicstartap
(
u8
,
u32
addr
);
void
lapicstartap
(
u8
,
u32
addr
);
void
lapiceoi
(
void
);
void
lapiceoi
(
void
);
void
lapic_tlbflush
(
u32
);
void
lapic_tlbflush
(
u32
);
void
lapic_sampconf
(
u32
);
void
lapicpc
(
char
mask
);
void
lapicpc
(
char
mask
);
// mp.c
// mp.c
...
@@ -227,6 +228,7 @@ void rcu_gc_worker(void);
...
@@ -227,6 +228,7 @@ void rcu_gc_worker(void);
void
sampstart
(
void
);
void
sampstart
(
void
);
int
sampintr
(
struct
trapframe
*
);
int
sampintr
(
struct
trapframe
*
);
void
sampdump
(
void
);
void
sampdump
(
void
);
void
sampconf
(
void
);
// spinlock.c
// spinlock.c
void
acquire
(
struct
spinlock
*
);
void
acquire
(
struct
spinlock
*
);
...
...
lapic.c
浏览文件 @
561179c4
...
@@ -183,6 +183,12 @@ lapic_tlbflush(u32 cpu)
...
@@ -183,6 +183,12 @@ lapic_tlbflush(u32 cpu)
lapic_ipi
(
cpu
,
T_TLBFLUSH
);
lapic_ipi
(
cpu
,
T_TLBFLUSH
);
}
}
void
lapic_sampconf
(
u32
cpu
)
{
lapic_ipi
(
cpu
,
T_SAMPCONF
);
}
// Start additional processor running bootstrap code at addr.
// Start additional processor running bootstrap code at addr.
// See Appendix B of MultiProcessor Specification.
// See Appendix B of MultiProcessor Specification.
void
void
...
...
sampler.c
浏览文件 @
561179c4
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
#include "kernel.h"
#include "kernel.h"
#include "bits.h"
#include "bits.h"
#include "amd64.h"
#include "amd64.h"
#include "cpu.h"
static
const
u64
debug_sel
=
static
const
u64
debug_sel
=
0UL
<<
32
|
0UL
<<
32
|
...
@@ -87,13 +88,25 @@ sampdump(void)
...
@@ -87,13 +88,25 @@ sampdump(void)
}
}
void
void
samp
start
(
void
)
samp
conf
(
void
)
{
{
pushcli
();
pushcli
();
pmu
.
config
(
0
,
debug_sel
,
-
debug_cnt
);
pmu
.
config
(
0
,
debug_sel
,
-
debug_cnt
);
popcli
();
popcli
();
}
}
void
sampstart
(
void
)
{
for
(
struct
cpu
*
c
=
cpus
;
c
<
cpus
+
ncpu
;
c
++
)
{
if
(
c
==
cpus
+
cpunum
())
continue
;
lapic_sampconf
(
c
->
id
);
}
sampconf
();
}
static
int
static
int
samplog
(
struct
trapframe
*
tf
)
samplog
(
struct
trapframe
*
tf
)
{
{
...
...
trap.c
浏览文件 @
561179c4
...
@@ -113,8 +113,10 @@ trap(struct trapframe *tf)
...
@@ -113,8 +113,10 @@ trap(struct trapframe *tf)
lapiceoi
();
lapiceoi
();
lcr3
(
rcr3
());
lcr3
(
rcr3
());
break
;
break
;
case
T_SAMPCONF
:
//PAGEBREAK: 13
lapiceoi
();
sampconf
();
break
;
default:
default:
if
(
myproc
()
==
0
||
(
tf
->
cs
&
3
)
==
0
){
if
(
myproc
()
==
0
||
(
tf
->
cs
&
3
)
==
0
){
// In kernel, it must be our mistake.
// In kernel, it must be our mistake.
...
...
traps.h
浏览文件 @
561179c4
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
// processor defined exceptions or interrupt vectors.
// processor defined exceptions or interrupt vectors.
#define T_SYSCALL 64 // system call
#define T_SYSCALL 64 // system call
#define T_TLBFLUSH 65 // flush TLB
#define T_TLBFLUSH 65 // flush TLB
#define T_SAMPCONF 66 // configure event counters
#define T_DEFAULT 500 // catchall
#define T_DEFAULT 500 // catchall
#define T_IRQ0 32 // IRQ 0 corresponds to int T_IRQ
#define T_IRQ0 32 // IRQ 0 corresponds to int T_IRQ
...
...
编写
预览
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论