Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
86665c75
cloud-kernel
项目概览
openanolis
/
cloud-kernel
接近 2 年 前同步成功
通知
169
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看板
提交
86665c75
编写于
4月 07, 2009
作者:
I
Ingo Molnar
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'tracing/urgent' into tracing/ftrace
上级
93776a8e
1bbe2a83
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
42 addition
and
15 deletion
+42
-15
arch/x86/kernel/ftrace.c
arch/x86/kernel/ftrace.c
+0
-1
block/blk-core.c
block/blk-core.c
+1
-0
include/linux/ftrace.h
include/linux/ftrace.h
+6
-2
include/linux/init_task.h
include/linux/init_task.h
+2
-0
kernel/trace/blktrace.c
kernel/trace/blktrace.c
+4
-3
kernel/trace/trace.c
kernel/trace/trace.c
+16
-5
kernel/trace/trace.h
kernel/trace/trace.h
+1
-1
kernel/trace/trace_export.c
kernel/trace/trace_export.c
+1
-1
kernel/trace/trace_output.c
kernel/trace/trace_output.c
+1
-1
kernel/trace/trace_sched_switch.c
kernel/trace/trace_sched_switch.c
+3
-0
kernel/trace/trace_sched_wakeup.c
kernel/trace/trace_sched_wakeup.c
+7
-1
scripts/tracing/power.pl
scripts/tracing/power.pl
+0
-0
未找到文件。
arch/x86/kernel/ftrace.c
浏览文件 @
86665c75
...
...
@@ -20,7 +20,6 @@
#include <asm/cacheflush.h>
#include <asm/ftrace.h>
#include <linux/ftrace.h>
#include <asm/nops.h>
#include <asm/nmi.h>
...
...
block/blk-core.c
浏览文件 @
86665c75
...
...
@@ -132,6 +132,7 @@ void blk_rq_init(struct request_queue *q, struct request *rq)
INIT_HLIST_NODE
(
&
rq
->
hash
);
RB_CLEAR_NODE
(
&
rq
->
rb_node
);
rq
->
cmd
=
rq
->
__cmd
;
rq
->
cmd_len
=
BLK_MAX_CDB
;
rq
->
tag
=
-
1
;
rq
->
ref_count
=
1
;
}
...
...
include/linux/ftrace.h
浏览文件 @
86665c75
...
...
@@ -356,6 +356,9 @@ struct ftrace_graph_ret {
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
/* for init task */
#define INIT_FTRACE_GRAPH .ret_stack = NULL
/*
* Stack of return addresses for functions
* of a thread.
...
...
@@ -429,10 +432,11 @@ static inline void unpause_graph_tracing(void)
{
atomic_dec
(
&
current
->
tracing_graph_pause
);
}
#else
#else
/* !CONFIG_FUNCTION_GRAPH_TRACER */
#define __notrace_funcgraph
#define __irq_entry
#define INIT_FTRACE_GRAPH
static
inline
void
ftrace_graph_init_task
(
struct
task_struct
*
t
)
{
}
static
inline
void
ftrace_graph_exit_task
(
struct
task_struct
*
t
)
{
}
...
...
@@ -444,7 +448,7 @@ static inline int task_curr_ret_stack(struct task_struct *tsk)
static
inline
void
pause_graph_tracing
(
void
)
{
}
static
inline
void
unpause_graph_tracing
(
void
)
{
}
#endif
#endif
/* CONFIG_FUNCTION_GRAPH_TRACER */
#ifdef CONFIG_TRACING
#include <linux/sched.h>
...
...
include/linux/init_task.h
浏览文件 @
86665c75
...
...
@@ -5,6 +5,7 @@
#include <linux/irqflags.h>
#include <linux/utsname.h>
#include <linux/lockdep.h>
#include <linux/ftrace.h>
#include <linux/ipc.h>
#include <linux/pid_namespace.h>
#include <linux/user_namespace.h>
...
...
@@ -185,6 +186,7 @@ extern struct cred init_cred;
INIT_IDS \
INIT_TRACE_IRQFLAGS \
INIT_LOCKDEP \
INIT_FTRACE_GRAPH \
}
...
...
kernel/trace/blktrace.c
浏览文件 @
86665c75
...
...
@@ -327,10 +327,10 @@ static ssize_t blk_msg_write(struct file *filp, const char __user *buffer,
char
*
msg
;
struct
blk_trace
*
bt
;
if
(
count
>
BLK_TN_MAX_MSG
)
if
(
count
>
=
BLK_TN_MAX_MSG
)
return
-
EINVAL
;
msg
=
kmalloc
(
count
,
GFP_KERNEL
);
msg
=
kmalloc
(
count
+
1
,
GFP_KERNEL
);
if
(
msg
==
NULL
)
return
-
ENOMEM
;
...
...
@@ -339,6 +339,7 @@ static ssize_t blk_msg_write(struct file *filp, const char __user *buffer,
return
-
EFAULT
;
}
msg
[
count
]
=
'\0'
;
bt
=
filp
->
private_data
;
__trace_note_message
(
bt
,
"%s"
,
msg
);
kfree
(
msg
);
...
...
@@ -642,7 +643,7 @@ static void blk_add_trace_rq(struct request_queue *q, struct request *rq,
if
(
blk_pc_request
(
rq
))
{
what
|=
BLK_TC_ACT
(
BLK_TC_PC
);
__blk_add_trace
(
bt
,
0
,
rq
->
data_len
,
rw
,
what
,
rq
->
errors
,
sizeof
(
rq
->
cmd
)
,
rq
->
cmd
);
rq
->
cmd_len
,
rq
->
cmd
);
}
else
{
what
|=
BLK_TC_ACT
(
BLK_TC_FS
);
__blk_add_trace
(
bt
,
rq
->
hard_sector
,
rq
->
hard_nr_sectors
<<
9
,
...
...
kernel/trace/trace.c
浏览文件 @
86665c75
...
...
@@ -30,6 +30,7 @@
#include <linux/percpu.h>
#include <linux/splice.h>
#include <linux/kdebug.h>
#include <linux/string.h>
#include <linux/ctype.h>
#include <linux/init.h>
#include <linux/poll.h>
...
...
@@ -147,8 +148,7 @@ static int __init set_ftrace_dump_on_oops(char *str)
}
__setup
(
"ftrace_dump_on_oops"
,
set_ftrace_dump_on_oops
);
long
ns2usecs
(
cycle_t
nsec
)
unsigned
long
long
ns2usecs
(
cycle_t
nsec
)
{
nsec
+=
500
;
do_div
(
nsec
,
1000
);
...
...
@@ -1623,7 +1623,11 @@ static void test_cpu_buff_start(struct trace_iterator *iter)
return
;
cpumask_set_cpu
(
iter
->
cpu
,
iter
->
started
);
trace_seq_printf
(
s
,
"##### CPU %u buffer started ####
\n
"
,
iter
->
cpu
);
/* Don't print started cpu buffer for the first entry of the trace */
if
(
iter
->
idx
>
1
)
trace_seq_printf
(
s
,
"##### CPU %u buffer started ####
\n
"
,
iter
->
cpu
);
}
static
enum
print_line_t
print_trace_fmt
(
struct
trace_iterator
*
iter
)
...
...
@@ -1858,6 +1862,11 @@ __tracing_open(struct inode *inode, struct file *file)
if
(
current_trace
)
*
iter
->
trace
=
*
current_trace
;
if
(
!
alloc_cpumask_var
(
&
iter
->
started
,
GFP_KERNEL
))
goto
fail
;
cpumask_clear
(
iter
->
started
);
if
(
current_trace
&&
current_trace
->
print_max
)
iter
->
tr
=
&
max_tr
;
else
...
...
@@ -1908,6 +1917,7 @@ __tracing_open(struct inode *inode, struct file *file)
if
(
iter
->
buffer_iter
[
cpu
])
ring_buffer_read_finish
(
iter
->
buffer_iter
[
cpu
]);
}
free_cpumask_var
(
iter
->
started
);
fail:
mutex_unlock
(
&
trace_types_lock
);
kfree
(
iter
->
trace
);
...
...
@@ -1951,6 +1961,7 @@ static int tracing_release(struct inode *inode, struct file *file)
seq_release
(
inode
,
file
);
mutex_destroy
(
&
iter
->
mutex
);
free_cpumask_var
(
iter
->
started
);
kfree
(
iter
->
trace
);
kfree
(
iter
);
return
0
;
...
...
@@ -2349,9 +2360,9 @@ static const char readme_msg[] =
"# mkdir /debug
\n
"
"# mount -t debugfs nodev /debug
\n\n
"
"# cat /debug/tracing/available_tracers
\n
"
"wakeup preemptirqsoff preemptoff irqsoff f
trace sched_switch none
\n\n
"
"wakeup preemptirqsoff preemptoff irqsoff f
unction sched_switch nop
\n\n
"
"# cat /debug/tracing/current_tracer
\n
"
"no
ne
\n
"
"no
p
\n
"
"# echo sched_switch > /debug/tracing/current_tracer
\n
"
"# cat /debug/tracing/current_tracer
\n
"
"sched_switch
\n
"
...
...
kernel/trace/trace.h
浏览文件 @
86665c75
...
...
@@ -602,7 +602,7 @@ extern int trace_selftest_startup_branch(struct tracer *trace,
#endif
/* CONFIG_FTRACE_STARTUP_TEST */
extern
void
*
head_page
(
struct
trace_array_cpu
*
data
);
extern
long
ns2usecs
(
cycle_t
nsec
);
extern
unsigned
long
long
ns2usecs
(
cycle_t
nsec
);
extern
int
trace_vbprintk
(
unsigned
long
ip
,
const
char
*
fmt
,
va_list
args
);
extern
int
...
...
kernel/trace/trace_export.c
浏览文件 @
86665c75
...
...
@@ -40,7 +40,7 @@
#undef TRACE_FIELD_ZERO_CHAR
#define TRACE_FIELD_ZERO_CHAR(item) \
ret = trace_seq_printf(s, "\tfield:
char " #item ";\t" \
ret = trace_seq_printf(s, "\tfield:char " #item ";\t" \
"offset:%u;\tsize:0;\n", \
(unsigned int)offsetof(typeof(field), item)); \
if (!ret) \
...
...
kernel/trace/trace_output.c
浏览文件 @
86665c75
...
...
@@ -433,7 +433,7 @@ int trace_print_lat_context(struct trace_iterator *iter)
trace_find_cmdline
(
entry
->
pid
,
comm
);
ret
=
trace_seq_printf
(
s
,
"%16s %5d %3d %d %08x %08lx [%08lx]"
ret
=
trace_seq_printf
(
s
,
"%16s %5d %3d %d %08x %08lx [%08l
l
x]"
" %ld.%03ldms (+%ld.%03ldms): "
,
comm
,
entry
->
pid
,
iter
->
cpu
,
entry
->
flags
,
entry
->
preempt_count
,
iter
->
idx
,
...
...
kernel/trace/trace_sched_switch.c
浏览文件 @
86665c75
...
...
@@ -62,6 +62,9 @@ probe_sched_wakeup(struct rq *__rq, struct task_struct *wakee, int success)
pc
=
preempt_count
();
tracing_record_cmdline
(
current
);
if
(
sched_stopped
)
return
;
local_irq_save
(
flags
);
cpu
=
raw_smp_processor_id
();
data
=
ctx_trace
->
data
[
cpu
];
...
...
kernel/trace/trace_sched_wakeup.c
浏览文件 @
86665c75
...
...
@@ -154,7 +154,7 @@ probe_wakeup_sched_switch(struct rq *rq, struct task_struct *prev,
if
(
unlikely
(
!
tracer_enabled
||
next
!=
wakeup_task
))
goto
out_unlock
;
trace_function
(
wakeup_trace
,
CALLER_ADDR
1
,
CALLER_ADDR2
,
flags
,
pc
);
trace_function
(
wakeup_trace
,
CALLER_ADDR
0
,
CALLER_ADDR1
,
flags
,
pc
);
tracing_sched_switch_trace
(
wakeup_trace
,
prev
,
next
,
flags
,
pc
);
/*
...
...
@@ -257,6 +257,12 @@ probe_wakeup(struct rq *rq, struct task_struct *p, int success)
data
=
wakeup_trace
->
data
[
wakeup_cpu
];
data
->
preempt_timestamp
=
ftrace_now
(
cpu
);
tracing_sched_wakeup_trace
(
wakeup_trace
,
p
,
current
,
flags
,
pc
);
/*
* We must be careful in using CALLER_ADDR2. But since wake_up
* is not called by an assembly function (where as schedule is)
* it should be safe to use it here.
*/
trace_function
(
wakeup_trace
,
CALLER_ADDR1
,
CALLER_ADDR2
,
flags
,
pc
);
out_locked:
...
...
scripts/trac
e
/power.pl
→
scripts/trac
ing
/power.pl
浏览文件 @
86665c75
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录