Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
3d325bf0
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3d325bf0
编写于
8月 12, 2015
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'perf/urgent' into perf/core, to pick up fixes before applying new changes
Signed-off-by:
N
Ingo Molnar
<
mingo@kernel.org
>
上级
f1d800bf
d7a702f0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
90 addition
and
38 deletion
+90
-38
arch/x86/kernel/cpu/perf_event_intel.c
arch/x86/kernel/cpu/perf_event_intel.c
+16
-7
arch/x86/kernel/cpu/perf_event_intel_cqm.c
arch/x86/kernel/cpu/perf_event_intel_cqm.c
+3
-5
kernel/events/core.c
kernel/events/core.c
+65
-22
kernel/events/ring_buffer.c
kernel/events/ring_buffer.c
+6
-4
未找到文件。
arch/x86/kernel/cpu/perf_event_intel.c
浏览文件 @
3d325bf0
...
...
@@ -2758,7 +2758,7 @@ static int intel_pmu_cpu_prepare(int cpu)
if
(
x86_pmu
.
extra_regs
||
x86_pmu
.
lbr_sel_map
)
{
cpuc
->
shared_regs
=
allocate_shared_regs
(
cpu
);
if
(
!
cpuc
->
shared_regs
)
return
NOTIFY_BAD
;
goto
err
;
}
if
(
x86_pmu
.
flags
&
PMU_FL_EXCL_CNTRS
)
{
...
...
@@ -2766,18 +2766,27 @@ static int intel_pmu_cpu_prepare(int cpu)
cpuc
->
constraint_list
=
kzalloc
(
sz
,
GFP_KERNEL
);
if
(
!
cpuc
->
constraint_list
)
return
NOTIFY_BAD
;
goto
err_shared_regs
;
cpuc
->
excl_cntrs
=
allocate_excl_cntrs
(
cpu
);
if
(
!
cpuc
->
excl_cntrs
)
{
kfree
(
cpuc
->
constraint_list
);
kfree
(
cpuc
->
shared_regs
);
return
NOTIFY_BAD
;
}
if
(
!
cpuc
->
excl_cntrs
)
goto
err_constraint_list
;
cpuc
->
excl_thread_id
=
0
;
}
return
NOTIFY_OK
;
err_constraint_list:
kfree
(
cpuc
->
constraint_list
);
cpuc
->
constraint_list
=
NULL
;
err_shared_regs:
kfree
(
cpuc
->
shared_regs
);
cpuc
->
shared_regs
=
NULL
;
err:
return
NOTIFY_BAD
;
}
static
void
intel_pmu_cpu_starting
(
int
cpu
)
...
...
arch/x86/kernel/cpu/perf_event_intel_cqm.c
浏览文件 @
3d325bf0
...
...
@@ -1255,7 +1255,7 @@ static inline void cqm_pick_event_reader(int cpu)
cpumask_set_cpu
(
cpu
,
&
cqm_cpumask
);
}
static
void
intel_cqm_cpu_
prepare
(
unsigned
int
cpu
)
static
void
intel_cqm_cpu_
starting
(
unsigned
int
cpu
)
{
struct
intel_pqr_state
*
state
=
&
per_cpu
(
pqr_state
,
cpu
);
struct
cpuinfo_x86
*
c
=
&
cpu_data
(
cpu
);
...
...
@@ -1296,13 +1296,11 @@ static int intel_cqm_cpu_notifier(struct notifier_block *nb,
unsigned
int
cpu
=
(
unsigned
long
)
hcpu
;
switch
(
action
&
~
CPU_TASKS_FROZEN
)
{
case
CPU_UP_PREPARE
:
intel_cqm_cpu_prepare
(
cpu
);
break
;
case
CPU_DOWN_PREPARE
:
intel_cqm_cpu_exit
(
cpu
);
break
;
case
CPU_STARTING
:
intel_cqm_cpu_starting
(
cpu
);
cqm_pick_event_reader
(
cpu
);
break
;
}
...
...
@@ -1373,7 +1371,7 @@ static int __init intel_cqm_init(void)
goto
out
;
for_each_online_cpu
(
i
)
{
intel_cqm_cpu_
prepare
(
i
);
intel_cqm_cpu_
starting
(
i
);
cqm_pick_event_reader
(
i
);
}
...
...
kernel/events/core.c
浏览文件 @
3d325bf0
...
...
@@ -3972,28 +3972,21 @@ static void perf_event_for_each(struct perf_event *event,
perf_event_for_each_child
(
sibling
,
func
);
}
static
int
perf_event_period
(
struct
perf_event
*
event
,
u64
__user
*
arg
)
{
struct
perf_event_context
*
ctx
=
event
->
ctx
;
int
ret
=
0
,
active
;
struct
period_event
{
struct
perf_event
*
event
;
u64
value
;
};
if
(
!
is_sampling_event
(
event
))
return
-
EINVAL
;
if
(
copy_from_user
(
&
value
,
arg
,
sizeof
(
value
)))
return
-
EFAULT
;
if
(
!
value
)
return
-
EINVAL
;
static
int
__perf_event_period
(
void
*
info
)
{
struct
period_event
*
pe
=
info
;
struct
perf_event
*
event
=
pe
->
event
;
struct
perf_event_context
*
ctx
=
event
->
ctx
;
u64
value
=
pe
->
value
;
bool
active
;
raw_spin_lock
_irq
(
&
ctx
->
lock
);
raw_spin_lock
(
&
ctx
->
lock
);
if
(
event
->
attr
.
freq
)
{
if
(
value
>
sysctl_perf_event_sample_rate
)
{
ret
=
-
EINVAL
;
goto
unlock
;
}
event
->
attr
.
sample_freq
=
value
;
}
else
{
event
->
attr
.
sample_period
=
value
;
...
...
@@ -4012,11 +4005,53 @@ static int perf_event_period(struct perf_event *event, u64 __user *arg)
event
->
pmu
->
start
(
event
,
PERF_EF_RELOAD
);
perf_pmu_enable
(
ctx
->
pmu
);
}
raw_spin_unlock
(
&
ctx
->
lock
);
unlock:
return
0
;
}
static
int
perf_event_period
(
struct
perf_event
*
event
,
u64
__user
*
arg
)
{
struct
period_event
pe
=
{
.
event
=
event
,
};
struct
perf_event_context
*
ctx
=
event
->
ctx
;
struct
task_struct
*
task
;
u64
value
;
if
(
!
is_sampling_event
(
event
))
return
-
EINVAL
;
if
(
copy_from_user
(
&
value
,
arg
,
sizeof
(
value
)))
return
-
EFAULT
;
if
(
!
value
)
return
-
EINVAL
;
if
(
event
->
attr
.
freq
&&
value
>
sysctl_perf_event_sample_rate
)
return
-
EINVAL
;
task
=
ctx
->
task
;
pe
.
value
=
value
;
if
(
!
task
)
{
cpu_function_call
(
event
->
cpu
,
__perf_event_period
,
&
pe
);
return
0
;
}
retry:
if
(
!
task_function_call
(
task
,
__perf_event_period
,
&
pe
))
return
0
;
raw_spin_lock_irq
(
&
ctx
->
lock
);
if
(
ctx
->
is_active
)
{
raw_spin_unlock_irq
(
&
ctx
->
lock
);
task
=
ctx
->
task
;
goto
retry
;
}
__perf_event_period
(
&
pe
);
raw_spin_unlock_irq
(
&
ctx
->
lock
);
return
ret
;
return
0
;
}
static
const
struct
file_operations
perf_fops
;
...
...
@@ -4754,12 +4789,20 @@ static const struct file_operations perf_fops = {
* to user-space before waking everybody up.
*/
static
inline
struct
fasync_struct
**
perf_event_fasync
(
struct
perf_event
*
event
)
{
/* only the parent has fasync state */
if
(
event
->
parent
)
event
=
event
->
parent
;
return
&
event
->
fasync
;
}
void
perf_event_wakeup
(
struct
perf_event
*
event
)
{
ring_buffer_wakeup
(
event
);
if
(
event
->
pending_kill
)
{
kill_fasync
(
&
event
->
fasync
,
SIGIO
,
event
->
pending_kill
);
kill_fasync
(
perf_event_fasync
(
event
)
,
SIGIO
,
event
->
pending_kill
);
event
->
pending_kill
=
0
;
}
}
...
...
@@ -6221,7 +6264,7 @@ static int __perf_event_overflow(struct perf_event *event,
else
perf_event_output
(
event
,
data
,
regs
);
if
(
event
->
fasync
&&
event
->
pending_kill
)
{
if
(
*
perf_event_fasync
(
event
)
&&
event
->
pending_kill
)
{
event
->
pending_wakeup
=
1
;
irq_work_queue
(
&
event
->
pending
);
}
...
...
kernel/events/ring_buffer.c
浏览文件 @
3d325bf0
...
...
@@ -559,11 +559,13 @@ static void __rb_free_aux(struct ring_buffer *rb)
rb
->
aux_priv
=
NULL
;
}
for
(
pg
=
0
;
pg
<
rb
->
aux_nr_pages
;
pg
++
)
rb_free_aux_page
(
rb
,
pg
);
if
(
rb
->
aux_nr_pages
)
{
for
(
pg
=
0
;
pg
<
rb
->
aux_nr_pages
;
pg
++
)
rb_free_aux_page
(
rb
,
pg
);
kfree
(
rb
->
aux_pages
);
rb
->
aux_nr_pages
=
0
;
kfree
(
rb
->
aux_pages
);
rb
->
aux_nr_pages
=
0
;
}
}
void
rb_free_aux
(
struct
ring_buffer
*
rb
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录