Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
9b036389
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看板
提交
9b036389
编写于
1月 23, 2009
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'tracing/ftrace' into tracing/core
上级
03b30d15
69507c06
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
61 addition
and
37 deletion
+61
-37
kernel/trace/ring_buffer.c
kernel/trace/ring_buffer.c
+18
-0
kernel/trace/trace.c
kernel/trace/trace.c
+1
-1
kernel/trace/trace_sched_wakeup.c
kernel/trace/trace_sched_wakeup.c
+42
-36
未找到文件。
kernel/trace/ring_buffer.c
浏览文件 @
9b036389
...
...
@@ -2166,6 +2166,9 @@ rb_reset_cpu(struct ring_buffer_per_cpu *cpu_buffer)
cpu_buffer
->
overrun
=
0
;
cpu_buffer
->
entries
=
0
;
cpu_buffer
->
write_stamp
=
0
;
cpu_buffer
->
read_stamp
=
0
;
}
/**
...
...
@@ -2266,9 +2269,24 @@ int ring_buffer_swap_cpu(struct ring_buffer *buffer_a,
if
(
buffer_a
->
pages
!=
buffer_b
->
pages
)
return
-
EINVAL
;
if
(
ring_buffer_flags
!=
RB_BUFFERS_ON
)
return
-
EAGAIN
;
if
(
atomic_read
(
&
buffer_a
->
record_disabled
))
return
-
EAGAIN
;
if
(
atomic_read
(
&
buffer_b
->
record_disabled
))
return
-
EAGAIN
;
cpu_buffer_a
=
buffer_a
->
buffers
[
cpu
];
cpu_buffer_b
=
buffer_b
->
buffers
[
cpu
];
if
(
atomic_read
(
&
cpu_buffer_a
->
record_disabled
))
return
-
EAGAIN
;
if
(
atomic_read
(
&
cpu_buffer_b
->
record_disabled
))
return
-
EAGAIN
;
/*
* We can't do a synchronize_sched here because this
* function can be called in atomic context.
...
...
kernel/trace/trace.c
浏览文件 @
9b036389
...
...
@@ -415,7 +415,7 @@ update_max_tr_single(struct trace_array *tr, struct task_struct *tsk, int cpu)
ftrace_enable_cpu
();
WARN_ON_ONCE
(
ret
);
WARN_ON_ONCE
(
ret
&&
ret
!=
-
EAGAIN
);
__update_max_tr
(
tr
,
tsk
,
cpu
);
__raw_spin_unlock
(
&
ftrace_max_lock
);
...
...
kernel/trace/trace_sched_wakeup.c
浏览文件 @
9b036389
...
...
@@ -25,6 +25,7 @@ static int __read_mostly tracer_enabled;
static
struct
task_struct
*
wakeup_task
;
static
int
wakeup_cpu
;
static
unsigned
wakeup_prio
=
-
1
;
static
int
wakeup_rt
;
static
raw_spinlock_t
wakeup_lock
=
(
raw_spinlock_t
)
__RAW_SPIN_LOCK_UNLOCKED
;
...
...
@@ -152,6 +153,7 @@ probe_wakeup_sched_switch(struct rq *rq, struct task_struct *prev,
goto
out_unlock
;
trace_function
(
wakeup_trace
,
data
,
CALLER_ADDR1
,
CALLER_ADDR2
,
flags
,
pc
);
tracing_sched_switch_trace
(
wakeup_trace
,
data
,
prev
,
next
,
flags
,
pc
);
/*
* usecs conversion is slow so we try to delay the conversion
...
...
@@ -213,6 +215,7 @@ static void wakeup_reset(struct trace_array *tr)
static
void
probe_wakeup
(
struct
rq
*
rq
,
struct
task_struct
*
p
,
int
success
)
{
struct
trace_array_cpu
*
data
;
int
cpu
=
smp_processor_id
();
unsigned
long
flags
;
long
disabled
;
...
...
@@ -224,7 +227,7 @@ probe_wakeup(struct rq *rq, struct task_struct *p, int success)
tracing_record_cmdline
(
p
);
tracing_record_cmdline
(
current
);
if
(
likely
(
!
rt_task
(
p
))
||
if
(
(
wakeup_rt
&&
!
rt_task
(
p
))
||
p
->
prio
>=
wakeup_prio
||
p
->
prio
>=
current
->
prio
)
return
;
...
...
@@ -252,9 +255,12 @@ probe_wakeup(struct rq *rq, struct task_struct *p, int success)
local_save_flags
(
flags
);
wakeup_trace
->
data
[
wakeup_cpu
]
->
preempt_timestamp
=
ftrace_now
(
cpu
);
trace_function
(
wakeup_trace
,
wakeup_trace
->
data
[
wakeup_cpu
],
CALLER_ADDR1
,
CALLER_ADDR2
,
flags
,
pc
);
data
=
wakeup_trace
->
data
[
wakeup_cpu
];
data
->
preempt_timestamp
=
ftrace_now
(
cpu
);
tracing_sched_wakeup_trace
(
wakeup_trace
,
data
,
p
,
current
,
flags
,
pc
);
trace_function
(
wakeup_trace
,
data
,
CALLER_ADDR1
,
CALLER_ADDR2
,
flags
,
pc
);
out_locked:
__raw_spin_unlock
(
&
wakeup_lock
);
...
...
@@ -262,12 +268,6 @@ probe_wakeup(struct rq *rq, struct task_struct *p, int success)
atomic_dec
(
&
wakeup_trace
->
data
[
cpu
]
->
disabled
);
}
/*
* save_tracer_enabled is used to save the state of the tracer_enabled
* variable when we disable it when we open a trace output file.
*/
static
int
save_tracer_enabled
;
static
void
start_wakeup_tracer
(
struct
trace_array
*
tr
)
{
int
ret
;
...
...
@@ -306,13 +306,10 @@ static void start_wakeup_tracer(struct trace_array *tr)
register_ftrace_function
(
&
trace_ops
);
if
(
tracing_is_enabled
())
{
if
(
tracing_is_enabled
())
tracer_enabled
=
1
;
save_tracer_enabled
=
1
;
}
else
{
else
tracer_enabled
=
0
;
save_tracer_enabled
=
0
;
}
return
;
fail_deprobe_wake_new:
...
...
@@ -324,14 +321,13 @@ static void start_wakeup_tracer(struct trace_array *tr)
static
void
stop_wakeup_tracer
(
struct
trace_array
*
tr
)
{
tracer_enabled
=
0
;
save_tracer_enabled
=
0
;
unregister_ftrace_function
(
&
trace_ops
);
unregister_trace_sched_switch
(
probe_wakeup_sched_switch
);
unregister_trace_sched_wakeup_new
(
probe_wakeup
);
unregister_trace_sched_wakeup
(
probe_wakeup
);
}
static
int
wakeup_tracer_init
(
struct
trace_array
*
tr
)
static
int
__
wakeup_tracer_init
(
struct
trace_array
*
tr
)
{
tracing_max_latency
=
0
;
wakeup_trace
=
tr
;
...
...
@@ -339,6 +335,18 @@ static int wakeup_tracer_init(struct trace_array *tr)
return
0
;
}
static
int
wakeup_tracer_init
(
struct
trace_array
*
tr
)
{
wakeup_rt
=
0
;
return
__wakeup_tracer_init
(
tr
);
}
static
int
wakeup_rt_tracer_init
(
struct
trace_array
*
tr
)
{
wakeup_rt
=
1
;
return
__wakeup_tracer_init
(
tr
);
}
static
void
wakeup_tracer_reset
(
struct
trace_array
*
tr
)
{
stop_wakeup_tracer
(
tr
);
...
...
@@ -350,28 +358,11 @@ static void wakeup_tracer_start(struct trace_array *tr)
{
wakeup_reset
(
tr
);
tracer_enabled
=
1
;
save_tracer_enabled
=
1
;
}
static
void
wakeup_tracer_stop
(
struct
trace_array
*
tr
)
{
tracer_enabled
=
0
;
save_tracer_enabled
=
0
;
}
static
void
wakeup_tracer_open
(
struct
trace_iterator
*
iter
)
{
/* stop the trace while dumping */
tracer_enabled
=
0
;
}
static
void
wakeup_tracer_close
(
struct
trace_iterator
*
iter
)
{
/* forget about any processes we were recording */
if
(
save_tracer_enabled
)
{
wakeup_reset
(
iter
->
tr
);
tracer_enabled
=
1
;
}
}
static
struct
tracer
wakeup_tracer
__read_mostly
=
...
...
@@ -381,8 +372,19 @@ static struct tracer wakeup_tracer __read_mostly =
.
reset
=
wakeup_tracer_reset
,
.
start
=
wakeup_tracer_start
,
.
stop
=
wakeup_tracer_stop
,
.
open
=
wakeup_tracer_open
,
.
close
=
wakeup_tracer_close
,
.
print_max
=
1
,
#ifdef CONFIG_FTRACE_SELFTEST
.
selftest
=
trace_selftest_startup_wakeup
,
#endif
};
static
struct
tracer
wakeup_rt_tracer
__read_mostly
=
{
.
name
=
"wakeup_rt"
,
.
init
=
wakeup_rt_tracer_init
,
.
reset
=
wakeup_tracer_reset
,
.
start
=
wakeup_tracer_start
,
.
stop
=
wakeup_tracer_stop
,
.
print_max
=
1
,
#ifdef CONFIG_FTRACE_SELFTEST
.
selftest
=
trace_selftest_startup_wakeup
,
...
...
@@ -397,6 +399,10 @@ __init static int init_wakeup_tracer(void)
if
(
ret
)
return
ret
;
ret
=
register_tracer
(
&
wakeup_rt_tracer
);
if
(
ret
)
return
ret
;
return
0
;
}
device_initcall
(
init_wakeup_tracer
);
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录