Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
1d7bf993
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
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看板
提交
1d7bf993
编写于
9月 06, 2013
作者:
R
Ralf Baechle
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
MIPS: ftrace: Add support for syscall tracepoints.
Signed-off-by:
N
Ralf Baechle
<
ralf@linux-mips.org
>
上级
0dfa95aa
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
43 addition
and
3 deletion
+43
-3
arch/mips/Kconfig
arch/mips/Kconfig
+1
-0
arch/mips/include/asm/syscall.h
arch/mips/include/asm/syscall.h
+19
-0
arch/mips/include/asm/thread_info.h
arch/mips/include/asm/thread_info.h
+6
-3
arch/mips/include/asm/unistd.h
arch/mips/include/asm/unistd.h
+7
-0
arch/mips/kernel/ptrace.c
arch/mips/kernel/ptrace.c
+10
-0
未找到文件。
arch/mips/Kconfig
浏览文件 @
1d7bf993
...
...
@@ -19,6 +19,7 @@ config MIPS
select HAVE_KPROBES
select HAVE_KRETPROBES
select HAVE_DEBUG_KMEMLEAK
select HAVE_SYSCALL_TRACEPOINTS
select ARCH_BINFMT_ELF_RANDOMIZE_PIE
select HAVE_ARCH_TRANSPARENT_HUGEPAGE if CPU_SUPPORTS_HUGEPAGES && 64BIT
select RTC_LIB if !MACH_LOONGSON
...
...
arch/mips/include/asm/syscall.h
浏览文件 @
1d7bf993
...
...
@@ -59,6 +59,25 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
}
}
static
inline
long
syscall_get_return_value
(
struct
task_struct
*
task
,
struct
pt_regs
*
regs
)
{
return
regs
->
regs
[
2
];
}
static
inline
void
syscall_set_return_value
(
struct
task_struct
*
task
,
struct
pt_regs
*
regs
,
int
error
,
long
val
)
{
if
(
error
)
{
regs
->
regs
[
2
]
=
-
error
;
regs
->
regs
[
7
]
=
-
1
;
}
else
{
regs
->
regs
[
2
]
=
val
;
regs
->
regs
[
7
]
=
0
;
}
}
static
inline
void
syscall_get_arguments
(
struct
task_struct
*
task
,
struct
pt_regs
*
regs
,
unsigned
int
i
,
unsigned
int
n
,
...
...
arch/mips/include/asm/thread_info.h
浏览文件 @
1d7bf993
...
...
@@ -116,6 +116,7 @@ static inline struct thread_info *current_thread_info(void)
#define TIF_32BIT_ADDR 23
/* 32-bit address space (o32/n32) */
#define TIF_FPUBOUND 24
/* thread bound to FPU-full CPU set */
#define TIF_LOAD_WATCH 25
/* If set, load watch registers */
#define TIF_SYSCALL_TRACEPOINT 26
/* syscall tracepoint instrumentation */
#define TIF_SYSCALL_TRACE 31
/* syscall trace active */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
...
...
@@ -132,20 +133,22 @@ static inline struct thread_info *current_thread_info(void)
#define _TIF_32BIT_ADDR (1<<TIF_32BIT_ADDR)
#define _TIF_FPUBOUND (1<<TIF_FPUBOUND)
#define _TIF_LOAD_WATCH (1<<TIF_LOAD_WATCH)
#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
#define _TIF_WORK_SYSCALL_ENTRY (_TIF_NOHZ | _TIF_SYSCALL_TRACE | \
_TIF_SYSCALL_AUDIT)
_TIF_SYSCALL_AUDIT
| _TIF_SYSCALL_TRACEPOINT
)
/* work to do in syscall_trace_leave() */
#define _TIF_WORK_SYSCALL_EXIT (_TIF_NOHZ | _TIF_SYSCALL_TRACE | \
_TIF_SYSCALL_AUDIT)
_TIF_SYSCALL_AUDIT
| _TIF_SYSCALL_TRACEPOINT
)
/* work to do on interrupt/exception return */
#define _TIF_WORK_MASK \
(_TIF_SIGPENDING | _TIF_NEED_RESCHED | _TIF_NOTIFY_RESUME)
/* work to do on any return to u-space */
#define _TIF_ALLWORK_MASK (_TIF_NOHZ | _TIF_WORK_MASK | \
_TIF_WORK_SYSCALL_EXIT)
_TIF_WORK_SYSCALL_EXIT | \
_TIF_SYSCALL_TRACEPOINT)
/*
* We stash processor id into a COP0 register to retrieve it fast
...
...
arch/mips/include/asm/unistd.h
浏览文件 @
1d7bf993
...
...
@@ -14,6 +14,13 @@
#include <uapi/asm/unistd.h>
#ifdef CONFIG_MIPS32_N32
#define NR_syscalls (__NR_N32_Linux + __NR_N32_Linux_syscalls)
#elif defined(CONFIG_64BIT)
#define NR_syscalls (__NR_64_Linux + __NR_64_Linux_syscalls)
#else
#define NR_syscalls (__NR_O32_Linux + __NR_O32_Linux_syscalls)
#endif
#ifndef __ASSEMBLY__
...
...
arch/mips/kernel/ptrace.c
浏览文件 @
1d7bf993
...
...
@@ -29,6 +29,7 @@
#include <linux/tracehook.h>
#include <linux/audit.h>
#include <linux/seccomp.h>
#include <linux/ftrace.h>
#include <asm/byteorder.h>
#include <asm/cpu.h>
...
...
@@ -43,6 +44,9 @@
#include <asm/bootinfo.h>
#include <asm/reg.h>
#define CREATE_TRACE_POINTS
#include <trace/events/syscalls.h>
/*
* Called by kernel/ptrace.c when detaching..
*
...
...
@@ -664,6 +668,9 @@ asmlinkage void syscall_trace_enter(struct pt_regs *regs)
tracehook_report_syscall_entry
(
regs
))
ret
=
-
1
;
if
(
unlikely
(
test_thread_flag
(
TIF_SYSCALL_TRACEPOINT
)))
trace_sys_enter
(
regs
,
regs
->
regs
[
2
]);
audit_syscall_entry
(
__syscall_get_arch
(),
regs
->
regs
[
2
],
regs
->
regs
[
4
],
regs
->
regs
[
5
],
...
...
@@ -685,6 +692,9 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs)
audit_syscall_exit
(
regs
);
if
(
unlikely
(
test_thread_flag
(
TIF_SYSCALL_TRACEPOINT
)))
trace_sys_exit
(
regs
,
regs
->
regs
[
2
]);
if
(
test_thread_flag
(
TIF_SYSCALL_TRACE
))
tracehook_report_syscall_exit
(
regs
,
0
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录