Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
4167ab90
K
kernel_linux
项目概览
OpenHarmony
/
kernel_linux
上一次同步 4 年多
通知
15
Star
8
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kernel_linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
4167ab90
编写于
9月 29, 2011
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'core' of
git://amd64.org/linux/rric
into perf/core
上级
d6eed550
298557db
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
2 addition
and
25 deletion
+2
-25
arch/x86/oprofile/op_model_ppro.c
arch/x86/oprofile/op_model_ppro.c
+2
-25
未找到文件。
arch/x86/oprofile/op_model_ppro.c
浏览文件 @
4167ab90
...
@@ -28,7 +28,7 @@ static int counter_width = 32;
...
@@ -28,7 +28,7 @@ static int counter_width = 32;
#define MSR_PPRO_EVENTSEL_RESERVED ((0xFFFFFFFFULL<<32)|(1ULL<<21))
#define MSR_PPRO_EVENTSEL_RESERVED ((0xFFFFFFFFULL<<32)|(1ULL<<21))
static
u64
*
reset_value
;
static
u64
reset_value
[
OP_MAX_COUNTER
]
;
static
void
ppro_shutdown
(
struct
op_msrs
const
*
const
msrs
)
static
void
ppro_shutdown
(
struct
op_msrs
const
*
const
msrs
)
{
{
...
@@ -40,10 +40,6 @@ static void ppro_shutdown(struct op_msrs const * const msrs)
...
@@ -40,10 +40,6 @@ static void ppro_shutdown(struct op_msrs const * const msrs)
release_perfctr_nmi
(
MSR_P6_PERFCTR0
+
i
);
release_perfctr_nmi
(
MSR_P6_PERFCTR0
+
i
);
release_evntsel_nmi
(
MSR_P6_EVNTSEL0
+
i
);
release_evntsel_nmi
(
MSR_P6_EVNTSEL0
+
i
);
}
}
if
(
reset_value
)
{
kfree
(
reset_value
);
reset_value
=
NULL
;
}
}
}
static
int
ppro_fill_in_addresses
(
struct
op_msrs
*
const
msrs
)
static
int
ppro_fill_in_addresses
(
struct
op_msrs
*
const
msrs
)
...
@@ -79,13 +75,6 @@ static void ppro_setup_ctrs(struct op_x86_model_spec const *model,
...
@@ -79,13 +75,6 @@ static void ppro_setup_ctrs(struct op_x86_model_spec const *model,
u64
val
;
u64
val
;
int
i
;
int
i
;
if
(
!
reset_value
)
{
reset_value
=
kzalloc
(
sizeof
(
reset_value
[
0
])
*
num_counters
,
GFP_ATOMIC
);
if
(
!
reset_value
)
return
;
}
if
(
cpu_has_arch_perfmon
)
{
if
(
cpu_has_arch_perfmon
)
{
union
cpuid10_eax
eax
;
union
cpuid10_eax
eax
;
eax
.
full
=
cpuid_eax
(
0xa
);
eax
.
full
=
cpuid_eax
(
0xa
);
...
@@ -141,13 +130,6 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
...
@@ -141,13 +130,6 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
u64
val
;
u64
val
;
int
i
;
int
i
;
/*
* This can happen if perf counters are in use when
* we steal the die notifier NMI.
*/
if
(
unlikely
(
!
reset_value
))
goto
out
;
for
(
i
=
0
;
i
<
num_counters
;
++
i
)
{
for
(
i
=
0
;
i
<
num_counters
;
++
i
)
{
if
(
!
reset_value
[
i
])
if
(
!
reset_value
[
i
])
continue
;
continue
;
...
@@ -158,7 +140,6 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
...
@@ -158,7 +140,6 @@ static int ppro_check_ctrs(struct pt_regs * const regs,
wrmsrl
(
msrs
->
counters
[
i
].
addr
,
-
reset_value
[
i
]);
wrmsrl
(
msrs
->
counters
[
i
].
addr
,
-
reset_value
[
i
]);
}
}
out:
/* Only P6 based Pentium M need to re-unmask the apic vector but it
/* Only P6 based Pentium M need to re-unmask the apic vector but it
* doesn't hurt other P6 variant */
* doesn't hurt other P6 variant */
apic_write
(
APIC_LVTPC
,
apic_read
(
APIC_LVTPC
)
&
~
APIC_LVT_MASKED
);
apic_write
(
APIC_LVTPC
,
apic_read
(
APIC_LVTPC
)
&
~
APIC_LVT_MASKED
);
...
@@ -179,8 +160,6 @@ static void ppro_start(struct op_msrs const * const msrs)
...
@@ -179,8 +160,6 @@ static void ppro_start(struct op_msrs const * const msrs)
u64
val
;
u64
val
;
int
i
;
int
i
;
if
(
!
reset_value
)
return
;
for
(
i
=
0
;
i
<
num_counters
;
++
i
)
{
for
(
i
=
0
;
i
<
num_counters
;
++
i
)
{
if
(
reset_value
[
i
])
{
if
(
reset_value
[
i
])
{
rdmsrl
(
msrs
->
controls
[
i
].
addr
,
val
);
rdmsrl
(
msrs
->
controls
[
i
].
addr
,
val
);
...
@@ -196,8 +175,6 @@ static void ppro_stop(struct op_msrs const * const msrs)
...
@@ -196,8 +175,6 @@ static void ppro_stop(struct op_msrs const * const msrs)
u64
val
;
u64
val
;
int
i
;
int
i
;
if
(
!
reset_value
)
return
;
for
(
i
=
0
;
i
<
num_counters
;
++
i
)
{
for
(
i
=
0
;
i
<
num_counters
;
++
i
)
{
if
(
!
reset_value
[
i
])
if
(
!
reset_value
[
i
])
continue
;
continue
;
...
@@ -242,7 +219,7 @@ static void arch_perfmon_setup_counters(void)
...
@@ -242,7 +219,7 @@ static void arch_perfmon_setup_counters(void)
eax
.
split
.
bit_width
=
40
;
eax
.
split
.
bit_width
=
40
;
}
}
num_counters
=
eax
.
split
.
num_counters
;
num_counters
=
min
((
int
)
eax
.
split
.
num_counters
,
OP_MAX_COUNTER
)
;
op_arch_perfmon_spec
.
num_counters
=
num_counters
;
op_arch_perfmon_spec
.
num_counters
=
num_counters
;
op_arch_perfmon_spec
.
num_controls
=
num_counters
;
op_arch_perfmon_spec
.
num_controls
=
num_counters
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录