Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
40874491
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
40874491
编写于
12月 18, 2008
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branches 'tracing/ftrace' and 'tracing/hw-branch-tracing' into tracing/core
上级
d680fe44
d072c25f
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
28 addition
and
33 deletion
+28
-33
arch/x86/kernel/ds.c
arch/x86/kernel/ds.c
+28
-33
未找到文件。
arch/x86/kernel/ds.c
浏览文件 @
40874491
...
...
@@ -232,53 +232,45 @@ static DEFINE_PER_CPU(struct ds_context *, system_context_array);
#define system_context per_cpu(system_context_array, smp_processor_id())
static
struct
ds_context
*
ds_get_context
(
struct
task_struct
*
task
)
static
inline
struct
ds_context
*
ds_get_context
(
struct
task_struct
*
task
)
{
struct
ds_context
**
p_context
=
(
task
?
&
task
->
thread
.
ds_ctx
:
&
system_context
);
struct
ds_context
*
context
=
*
p_context
;
struct
ds_context
*
context
=
NULL
;
struct
ds_context
*
new_context
=
NULL
;
unsigned
long
irq
;
if
(
!
context
)
{
context
=
kzalloc
(
sizeof
(
*
context
),
GFP_KERNEL
);
if
(
!
context
)
return
NULL
;
spin_lock_irqsave
(
&
ds_lock
,
irq
);
if
(
*
p_context
)
{
kfree
(
context
);
/* Chances are small that we already have a context. */
new_context
=
kzalloc
(
sizeof
(
*
new_context
),
GFP_KERNEL
);
if
(
!
new_context
)
return
NULL
;
context
=
*
p_context
;
}
else
{
*
p_context
=
context
;
spin_lock_irqsave
(
&
ds_lock
,
irq
);
context
->
this
=
p_context
;
context
->
task
=
task
;
context
=
*
p_context
;
if
(
!
context
)
{
context
=
new_context
;
if
(
task
)
set_tsk_thread_flag
(
task
,
TIF_DS_AREA_MSR
);
context
->
this
=
p_context
;
context
->
task
=
task
;
context
->
count
=
0
;
if
(
!
task
||
(
task
==
current
))
wrmsrl
(
MSR_IA32_DS_AREA
,
(
unsigned
long
)
context
->
ds
);
}
if
(
task
)
set_tsk_thread_flag
(
task
,
TIF_DS_AREA_MSR
);
context
->
count
++
;
if
(
!
task
||
(
task
==
current
))
wrmsrl
(
MSR_IA32_DS_AREA
,
(
unsigned
long
)
context
->
ds
);
spin_unlock_irqrestore
(
&
ds_lock
,
irq
);
}
else
{
spin_lock_irqsave
(
&
ds_lock
,
irq
);
*
p_context
=
context
;
}
context
=
*
p_context
;
if
(
context
)
context
->
count
++
;
context
->
count
++
;
spin_unlock_irqrestore
(
&
ds_lock
,
irq
);
spin_unlock_irqrestore
(
&
ds_lock
,
irq
);
if
(
!
context
)
context
=
ds_get_context
(
task
);
}
if
(
context
!=
new_context
)
kfree
(
new_context
);
return
context
;
}
...
...
@@ -492,6 +484,9 @@ static int bts_read(struct bts_tracer *tracer, const void *at,
out
->
qualifier
=
bts_branch
;
out
->
variant
.
lbr
.
from
=
bts_get
(
at
,
bts_from
);
out
->
variant
.
lbr
.
to
=
bts_get
(
at
,
bts_to
);
if
(
!
out
->
variant
.
lbr
.
from
&&
!
out
->
variant
.
lbr
.
to
)
out
->
qualifier
=
bts_invalid
;
}
return
ds_cfg
.
sizeof_rec
[
ds_bts
];
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录