Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
kernel_linux
提交
2e0f5761
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看板
提交
2e0f5761
编写于
5月 12, 2008
作者:
I
Ingo Molnar
提交者:
Thomas Gleixner
5月 23, 2008
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ftrace: build fix
Signed-off-by:
N
Ingo Molnar
<
mingo@elte.hu
>
Signed-off-by:
N
Thomas Gleixner
<
tglx@linutronix.de
>
上级
0fd9e0da
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
67 addition
and
46 deletion
+67
-46
kernel/trace/trace.c
kernel/trace/trace.c
+66
-45
kernel/trace/trace_functions.c
kernel/trace/trace_functions.c
+1
-1
未找到文件。
kernel/trace/trace.c
浏览文件 @
2e0f5761
...
@@ -432,47 +432,6 @@ notrace void tracing_reset(struct trace_array_cpu *data)
...
@@ -432,47 +432,6 @@ notrace void tracing_reset(struct trace_array_cpu *data)
data
->
trace_tail_idx
=
0
;
data
->
trace_tail_idx
=
0
;
}
}
#ifdef CONFIG_FTRACE
static
notrace
void
function_trace_call
(
unsigned
long
ip
,
unsigned
long
parent_ip
)
{
struct
trace_array
*
tr
=
&
global_trace
;
struct
trace_array_cpu
*
data
;
unsigned
long
flags
;
long
disabled
;
int
cpu
;
if
(
unlikely
(
!
tracer_enabled
))
return
;
local_irq_save
(
flags
);
cpu
=
raw_smp_processor_id
();
data
=
tr
->
data
[
cpu
];
disabled
=
atomic_inc_return
(
&
data
->
disabled
);
if
(
likely
(
disabled
==
1
))
ftrace
(
tr
,
data
,
ip
,
parent_ip
,
flags
);
atomic_dec
(
&
data
->
disabled
);
local_irq_restore
(
flags
);
}
static
struct
ftrace_ops
trace_ops
__read_mostly
=
{
.
func
=
function_trace_call
,
};
#endif
notrace
void
tracing_start_function_trace
(
void
)
{
register_ftrace_function
(
&
trace_ops
);
}
notrace
void
tracing_stop_function_trace
(
void
)
{
unregister_ftrace_function
(
&
trace_ops
);
}
#define SAVED_CMDLINES 128
#define SAVED_CMDLINES 128
static
unsigned
map_pid_to_cmdline
[
PID_MAX_DEFAULT
+
1
];
static
unsigned
map_pid_to_cmdline
[
PID_MAX_DEFAULT
+
1
];
static
unsigned
map_cmdline_to_pid
[
SAVED_CMDLINES
];
static
unsigned
map_cmdline_to_pid
[
SAVED_CMDLINES
];
...
@@ -635,8 +594,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags)
...
@@ -635,8 +594,8 @@ tracing_generic_entry_update(struct trace_entry *entry, unsigned long flags)
}
}
notrace
void
notrace
void
ftrace
(
struct
trace_array
*
tr
,
struct
trace_array_cpu
*
data
,
__
ftrace
(
struct
trace_array
*
tr
,
struct
trace_array_cpu
*
data
,
unsigned
long
ip
,
unsigned
long
parent_ip
,
unsigned
long
flags
)
unsigned
long
ip
,
unsigned
long
parent_ip
,
unsigned
long
flags
)
{
{
struct
trace_entry
*
entry
;
struct
trace_entry
*
entry
;
unsigned
long
irq_flags
;
unsigned
long
irq_flags
;
...
@@ -650,6 +609,14 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data,
...
@@ -650,6 +609,14 @@ ftrace(struct trace_array *tr, struct trace_array_cpu *data,
spin_unlock_irqrestore
(
&
data
->
lock
,
irq_flags
);
spin_unlock_irqrestore
(
&
data
->
lock
,
irq_flags
);
}
}
notrace
void
ftrace
(
struct
trace_array
*
tr
,
struct
trace_array_cpu
*
data
,
unsigned
long
ip
,
unsigned
long
parent_ip
,
unsigned
long
flags
)
{
if
(
likely
(
!
atomic_read
(
&
data
->
disabled
)))
__ftrace
(
tr
,
data
,
ip
,
parent_ip
,
flags
);
}
notrace
void
notrace
void
trace_special
(
struct
trace_array
*
tr
,
struct
trace_array_cpu
*
data
,
trace_special
(
struct
trace_array
*
tr
,
struct
trace_array_cpu
*
data
,
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
)
unsigned
long
arg1
,
unsigned
long
arg2
,
unsigned
long
arg3
)
...
@@ -688,6 +655,47 @@ tracing_sched_switch_trace(struct trace_array *tr,
...
@@ -688,6 +655,47 @@ tracing_sched_switch_trace(struct trace_array *tr,
spin_unlock_irqrestore
(
&
data
->
lock
,
irq_flags
);
spin_unlock_irqrestore
(
&
data
->
lock
,
irq_flags
);
}
}
#ifdef CONFIG_FTRACE
static
notrace
void
function_trace_call
(
unsigned
long
ip
,
unsigned
long
parent_ip
)
{
struct
trace_array
*
tr
=
&
global_trace
;
struct
trace_array_cpu
*
data
;
unsigned
long
flags
;
long
disabled
;
int
cpu
;
if
(
unlikely
(
!
tracer_enabled
))
return
;
local_irq_save
(
flags
);
cpu
=
raw_smp_processor_id
();
data
=
tr
->
data
[
cpu
];
disabled
=
atomic_inc_return
(
&
data
->
disabled
);
if
(
likely
(
disabled
==
1
))
__ftrace
(
tr
,
data
,
ip
,
parent_ip
,
flags
);
atomic_dec
(
&
data
->
disabled
);
local_irq_restore
(
flags
);
}
static
struct
ftrace_ops
trace_ops
__read_mostly
=
{
.
func
=
function_trace_call
,
};
notrace
void
tracing_start_function_trace
(
void
)
{
register_ftrace_function
(
&
trace_ops
);
}
notrace
void
tracing_stop_function_trace
(
void
)
{
unregister_ftrace_function
(
&
trace_ops
);
}
#endif
enum
trace_file_type
{
enum
trace_file_type
{
TRACE_FILE_LAT_FMT
=
1
,
TRACE_FILE_LAT_FMT
=
1
,
};
};
...
@@ -722,7 +730,7 @@ trace_entry_idx(struct trace_array *tr, struct trace_array_cpu *data,
...
@@ -722,7 +730,7 @@ trace_entry_idx(struct trace_array *tr, struct trace_array_cpu *data,
return
&
array
[
iter
->
next_page_idx
[
cpu
]];
return
&
array
[
iter
->
next_page_idx
[
cpu
]];
}
}
static
struct
notrace
trace_entry
*
static
struct
trace_entry
*
notrace
find_next_entry
(
struct
trace_iterator
*
iter
,
int
*
ent_cpu
)
find_next_entry
(
struct
trace_iterator
*
iter
,
int
*
ent_cpu
)
{
{
struct
trace_array
*
tr
=
iter
->
tr
;
struct
trace_array
*
tr
=
iter
->
tr
;
...
@@ -1866,6 +1874,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
...
@@ -1866,6 +1874,7 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
static
cpumask_t
mask
;
static
cpumask_t
mask
;
static
int
start
;
static
int
start
;
unsigned
long
flags
;
unsigned
long
flags
;
int
ftrace_save
;
int
read
=
0
;
int
read
=
0
;
int
cpu
;
int
cpu
;
int
len
;
int
len
;
...
@@ -1944,6 +1953,9 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
...
@@ -1944,6 +1953,9 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
cpus_clear
(
mask
);
cpus_clear
(
mask
);
local_irq_save
(
flags
);
local_irq_save
(
flags
);
ftrace_save
=
ftrace_enabled
;
ftrace_enabled
=
0
;
smp_wmb
();
for_each_possible_cpu
(
cpu
)
{
for_each_possible_cpu
(
cpu
)
{
data
=
iter
->
tr
->
data
[
cpu
];
data
=
iter
->
tr
->
data
[
cpu
];
...
@@ -1951,10 +1963,14 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
...
@@ -1951,10 +1963,14 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
continue
;
continue
;
atomic_inc
(
&
data
->
disabled
);
atomic_inc
(
&
data
->
disabled
);
spin_lock
(
&
data
->
lock
);
cpu_set
(
cpu
,
mask
);
cpu_set
(
cpu
,
mask
);
}
}
for_each_cpu_mask
(
cpu
,
mask
)
{
data
=
iter
->
tr
->
data
[
cpu
];
spin_lock
(
&
data
->
lock
);
}
while
(
find_next_entry_inc
(
iter
)
!=
NULL
)
{
while
(
find_next_entry_inc
(
iter
)
!=
NULL
)
{
int
len
=
iter
->
seq
.
len
;
int
len
=
iter
->
seq
.
len
;
...
@@ -1974,8 +1990,13 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
...
@@ -1974,8 +1990,13 @@ tracing_read_pipe(struct file *filp, char __user *ubuf,
for_each_cpu_mask
(
cpu
,
mask
)
{
for_each_cpu_mask
(
cpu
,
mask
)
{
data
=
iter
->
tr
->
data
[
cpu
];
data
=
iter
->
tr
->
data
[
cpu
];
spin_unlock
(
&
data
->
lock
);
spin_unlock
(
&
data
->
lock
);
}
for_each_cpu_mask
(
cpu
,
mask
)
{
data
=
iter
->
tr
->
data
[
cpu
];
atomic_dec
(
&
data
->
disabled
);
atomic_dec
(
&
data
->
disabled
);
}
}
ftrace_enabled
=
ftrace_save
;
local_irq_restore
(
flags
);
local_irq_restore
(
flags
);
/* Now copy what we have to the user */
/* Now copy what we have to the user */
...
...
kernel/trace/trace_functions.c
浏览文件 @
2e0f5761
...
@@ -9,10 +9,10 @@
...
@@ -9,10 +9,10 @@
* Copyright (C) 2004-2006 Ingo Molnar
* Copyright (C) 2004-2006 Ingo Molnar
* Copyright (C) 2004 William Lee Irwin III
* Copyright (C) 2004 William Lee Irwin III
*/
*/
#include <linux/fs.h>
#include <linux/debugfs.h>
#include <linux/debugfs.h>
#include <linux/uaccess.h>
#include <linux/uaccess.h>
#include <linux/ftrace.h>
#include <linux/ftrace.h>
#include <linux/fs.h>
#include "trace.h"
#include "trace.h"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录