Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
_Walt
cloud-kernel
提交
6712e299
cloud-kernel
项目概览
_Walt
/
cloud-kernel
与 Fork 源项目一致
Fork自
openanolis / cloud-kernel
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6712e299
编写于
7月 14, 2008
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'tracing/ftrace' into auto-ftrace-next
上级
ec1bb60b
b2613e37
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
54 addition
and
10 deletion
+54
-10
include/linux/ftrace.h
include/linux/ftrace.h
+1
-0
kernel/Makefile
kernel/Makefile
+1
-1
kernel/trace/ftrace.c
kernel/trace/ftrace.c
+17
-0
kernel/trace/trace.c
kernel/trace/trace.c
+20
-4
kernel/trace/trace.h
kernel/trace/trace.h
+8
-2
kernel/trace/trace_functions.c
kernel/trace/trace_functions.c
+3
-0
kernel/trace/trace_sched_switch.c
kernel/trace/trace_sched_switch.c
+2
-2
kernel/trace/trace_sched_wakeup.c
kernel/trace/trace_sched_wakeup.c
+2
-1
未找到文件。
include/linux/ftrace.h
浏览文件 @
6712e299
...
...
@@ -89,6 +89,7 @@ void ftrace_enable_daemon(void);
/* totally disable ftrace - can not re-enable after this */
void
ftrace_kill
(
void
);
void
ftrace_kill_atomic
(
void
);
static
inline
void
tracer_disable
(
void
)
{
...
...
kernel/Makefile
浏览文件 @
6712e299
...
...
@@ -11,7 +11,7 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \
hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o
\
notifier.o ksysfs.o pm_qos_params.o sched_clock.o
CFLAGS_REMOVE_sched.o
=
-
pg
-
mno-spe
CFLAGS_REMOVE_sched.o
=
-mno-spe
ifdef
CONFIG_FTRACE
# Do not trace debug files and internal ftrace files
...
...
kernel/trace/ftrace.c
浏览文件 @
6712e299
...
...
@@ -1601,6 +1601,23 @@ core_initcall(ftrace_dynamic_init);
# define ftrace_force_shutdown() do { } while (0)
#endif
/* CONFIG_DYNAMIC_FTRACE */
/**
* ftrace_kill_atomic - kill ftrace from critical sections
*
* This function should be used by panic code. It stops ftrace
* but in a not so nice way. If you need to simply kill ftrace
* from a non-atomic section, use ftrace_kill.
*/
void
ftrace_kill_atomic
(
void
)
{
ftrace_disabled
=
1
;
ftrace_enabled
=
0
;
#ifdef CONFIG_DYNAMIC_FTRACE
ftraced_suspend
=
-
1
;
#endif
clear_ftrace_function
();
}
/**
* ftrace_kill - totally shutdown ftrace
*
...
...
kernel/trace/trace.c
浏览文件 @
6712e299
...
...
@@ -96,6 +96,9 @@ static DEFINE_PER_CPU(struct trace_array_cpu, max_data);
/* tracer_enabled is used to toggle activation of a tracer */
static
int
tracer_enabled
=
1
;
/* function tracing enabled */
int
ftrace_function_enabled
;
/*
* trace_nr_entries is the number of entries that is allocated
* for a buffer. Note, the number of entries is always rounded
...
...
@@ -134,6 +137,7 @@ static notrace void no_trace_init(struct trace_array *tr)
{
int
cpu
;
ftrace_function_enabled
=
0
;
if
(
tr
->
ctrl
)
for_each_online_cpu
(
cpu
)
tracing_reset
(
tr
->
data
[
cpu
]);
...
...
@@ -1027,7 +1031,7 @@ function_trace_call(unsigned long ip, unsigned long parent_ip)
long
disabled
;
int
cpu
;
if
(
unlikely
(
!
tracer
_enabled
))
if
(
unlikely
(
!
ftrace_function
_enabled
))
return
;
if
(
skip_trace
(
ip
))
...
...
@@ -1052,11 +1056,15 @@ static struct ftrace_ops trace_ops __read_mostly =
void
tracing_start_function_trace
(
void
)
{
ftrace_function_enabled
=
0
;
register_ftrace_function
(
&
trace_ops
);
if
(
tracer_enabled
)
ftrace_function_enabled
=
1
;
}
void
tracing_stop_function_trace
(
void
)
{
ftrace_function_enabled
=
0
;
unregister_ftrace_function
(
&
trace_ops
);
}
#endif
...
...
@@ -1383,7 +1391,7 @@ print_trace_header(struct seq_file *m, struct trace_iterator *iter)
"server"
,
#elif defined(CONFIG_PREEMPT_VOLUNTARY)
"desktop"
,
#elif defined(CONFIG_PREEMPT
_DESKTOP
)
#elif defined(CONFIG_PREEMPT)
"preempt"
,
#else
"unknown"
,
...
...
@@ -1892,8 +1900,10 @@ __tracing_open(struct inode *inode, struct file *file, int *ret)
m
->
private
=
iter
;
/* stop the trace while dumping */
if
(
iter
->
tr
->
ctrl
)
if
(
iter
->
tr
->
ctrl
)
{
tracer_enabled
=
0
;
ftrace_function_enabled
=
0
;
}
if
(
iter
->
trace
&&
iter
->
trace
->
open
)
iter
->
trace
->
open
(
iter
);
...
...
@@ -1926,8 +1936,14 @@ int tracing_release(struct inode *inode, struct file *file)
iter
->
trace
->
close
(
iter
);
/* reenable tracing if it was previously enabled */
if
(
iter
->
tr
->
ctrl
)
if
(
iter
->
tr
->
ctrl
)
{
tracer_enabled
=
1
;
/*
* It is safe to enable function tracing even if it
* isn't used
*/
ftrace_function_enabled
=
1
;
}
mutex_unlock
(
&
trace_types_lock
);
seq_release
(
inode
,
file
);
...
...
kernel/trace/trace.h
浏览文件 @
6712e299
...
...
@@ -223,8 +223,6 @@ void trace_function(struct trace_array *tr,
unsigned
long
parent_ip
,
unsigned
long
flags
);
void
tracing_start_function_trace
(
void
);
void
tracing_stop_function_trace
(
void
);
void
tracing_start_cmdline_record
(
void
);
void
tracing_stop_cmdline_record
(
void
);
int
register_tracer
(
struct
tracer
*
type
);
...
...
@@ -241,6 +239,14 @@ void update_max_tr_single(struct trace_array *tr,
extern
cycle_t
ftrace_now
(
int
cpu
);
#ifdef CONFIG_FTRACE
void
tracing_start_function_trace
(
void
);
void
tracing_stop_function_trace
(
void
);
#else
# define tracing_start_function_trace() do { } while (0)
# define tracing_stop_function_trace() do { } while (0)
#endif
#ifdef CONFIG_CONTEXT_SWITCH_TRACER
typedef
void
(
*
tracer_switch_func_t
)(
void
*
private
,
...
...
kernel/trace/trace_functions.c
浏览文件 @
6712e299
...
...
@@ -28,7 +28,10 @@ static void function_reset(struct trace_array *tr)
static
void
start_function_trace
(
struct
trace_array
*
tr
)
{
tr
->
cpu
=
get_cpu
();
function_reset
(
tr
);
put_cpu
();
tracing_start_cmdline_record
();
tracing_start_function_trace
();
}
...
...
kernel/trace/trace_sched_switch.c
浏览文件 @
6712e299
...
...
@@ -227,14 +227,14 @@ void tracing_stop_cmdline_record(void)
static
void
start_sched_trace
(
struct
trace_array
*
tr
)
{
sched_switch_reset
(
tr
);
tracer_enabled
=
1
;
tracing_start_cmdline_record
();
tracer_enabled
=
1
;
}
static
void
stop_sched_trace
(
struct
trace_array
*
tr
)
{
tracing_stop_cmdline_record
();
tracer_enabled
=
0
;
tracing_stop_cmdline_record
();
}
static
void
sched_switch_trace_init
(
struct
trace_array
*
tr
)
...
...
kernel/trace/trace_sched_wakeup.c
浏览文件 @
6712e299
...
...
@@ -352,9 +352,10 @@ static void start_wakeup_tracer(struct trace_array *tr)
*/
smp_wmb
();
tracer_enabled
=
1
;
register_ftrace_function
(
&
trace_ops
);
tracer_enabled
=
1
;
return
;
fail_deprobe_wake_new:
marker_probe_unregister
(
"kernel_sched_wakeup_new"
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录