Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
c658ad1b
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c658ad1b
编写于
12月 11, 2009
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sparc64: Add syscall tracepoint support.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
4d14a459
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
33 addition
and
9 deletion
+33
-9
arch/sparc/Kconfig
arch/sparc/Kconfig
+1
-0
arch/sparc/include/asm/thread_info_64.h
arch/sparc/include/asm/thread_info_64.h
+2
-0
arch/sparc/include/asm/unistd.h
arch/sparc/include/asm/unistd.h
+1
-1
arch/sparc/kernel/entry.S
arch/sparc/kernel/entry.S
+1
-1
arch/sparc/kernel/ftrace.c
arch/sparc/kernel/ftrace.c
+11
-0
arch/sparc/kernel/ptrace_64.c
arch/sparc/kernel/ptrace_64.c
+10
-0
arch/sparc/kernel/syscalls.S
arch/sparc/kernel/syscalls.S
+7
-7
未找到文件。
arch/sparc/Kconfig
浏览文件 @
c658ad1b
...
...
@@ -43,6 +43,7 @@ config SPARC64
select HAVE_SYSCALL_WRAPPERS
select HAVE_DYNAMIC_FTRACE
select HAVE_FTRACE_MCOUNT_RECORD
select HAVE_SYSCALL_TRACEPOINTS
select USE_GENERIC_SMP_HELPERS if SMP
select RTC_DRV_CMOS
select RTC_DRV_BQ4802
...
...
arch/sparc/include/asm/thread_info_64.h
浏览文件 @
c658ad1b
...
...
@@ -227,6 +227,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
/* flag bit 8 is available */
#define TIF_SECCOMP 9
/* secure computing */
#define TIF_SYSCALL_AUDIT 10
/* syscall auditing active */
#define TIF_SYSCALL_TRACEPOINT 11
/* syscall tracepoint instrumentation */
/* flag bit 11 is available */
/* NOTE: Thread flags >= 12 should be ones we have no interest
* in using in assembly, else we can't use the mask as
...
...
@@ -246,6 +247,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
#define _TIF_32BIT (1<<TIF_32BIT)
#define _TIF_SECCOMP (1<<TIF_SECCOMP)
#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_FREEZE (1<<TIF_FREEZE)
...
...
arch/sparc/include/asm/unistd.h
浏览文件 @
c658ad1b
...
...
@@ -398,7 +398,7 @@
#define __NR_perf_event_open 327
#define __NR_recvmmsg 328
#define NR_
SYSCALLS
329
#define NR_
syscalls
329
#ifdef __32bit_syscall_numbers__
/* Sparc 32-bit only has the "setresuid32", "getresuid32" variants,
...
...
arch/sparc/kernel/entry.S
浏览文件 @
c658ad1b
...
...
@@ -1294,7 +1294,7 @@ linux_sparc_syscall:
sethi
%
hi
(
PSR_SYSCALL
),
%
l4
or
%
l0
,
%
l4
,
%
l0
/
*
Direct
access
to
user
regs
,
must
faster
.
*/
cmp
%
g1
,
NR_
SYSCALLS
cmp
%
g1
,
NR_
syscalls
bgeu
linux_sparc_ni_syscall
sll
%
g1
,
2
,
%
l4
ld
[%
l7
+
%
l4
],
%
l7
...
...
arch/sparc/kernel/ftrace.c
浏览文件 @
c658ad1b
...
...
@@ -4,6 +4,7 @@
#include <linux/percpu.h>
#include <linux/init.h>
#include <linux/list.h>
#include <trace/syscall.h>
#include <asm/ftrace.h>
...
...
@@ -91,3 +92,13 @@ int __init ftrace_dyn_arch_init(void *data)
}
#endif
#ifdef CONFIG_FTRACE_SYSCALLS
extern
unsigned
int
sys_call_table
[];
unsigned
long
__init
arch_syscall_addr
(
int
nr
)
{
return
(
unsigned
long
)
sys_call_table
[
nr
];
}
#endif
arch/sparc/kernel/ptrace_64.c
浏览文件 @
c658ad1b
...
...
@@ -23,6 +23,7 @@
#include <linux/signal.h>
#include <linux/regset.h>
#include <linux/tracehook.h>
#include <trace/syscall.h>
#include <linux/compat.h>
#include <linux/elf.h>
...
...
@@ -37,6 +38,9 @@
#include <asm/cpudata.h>
#include <asm/cacheflush.h>
#define CREATE_TRACE_POINTS
#include <trace/events/syscalls.h>
#include "entry.h"
/* #define ALLOW_INIT_TRACING */
...
...
@@ -1059,6 +1063,9 @@ asmlinkage int syscall_trace_enter(struct pt_regs *regs)
if
(
test_thread_flag
(
TIF_SYSCALL_TRACE
))
ret
=
tracehook_report_syscall_entry
(
regs
);
if
(
unlikely
(
test_thread_flag
(
TIF_SYSCALL_TRACEPOINT
)))
trace_sys_enter
(
regs
,
regs
->
u_regs
[
UREG_G1
]);
if
(
unlikely
(
current
->
audit_context
)
&&
!
ret
)
audit_syscall_entry
((
test_thread_flag
(
TIF_32BIT
)
?
AUDIT_ARCH_SPARC
:
...
...
@@ -1084,6 +1091,9 @@ asmlinkage void syscall_trace_leave(struct pt_regs *regs)
audit_syscall_exit
(
result
,
regs
->
u_regs
[
UREG_I0
]);
}
if
(
unlikely
(
test_thread_flag
(
TIF_SYSCALL_TRACEPOINT
)))
trace_sys_exit
(
regs
,
regs
->
u_regs
[
UREG_G1
]);
if
(
test_thread_flag
(
TIF_SYSCALL_TRACE
))
tracehook_report_syscall_exit
(
regs
,
0
);
}
arch/sparc/kernel/syscalls.S
浏览文件 @
c658ad1b
...
...
@@ -62,7 +62,7 @@ sys32_rt_sigreturn:
#endif
.
align
32
1
:
ldx
[%
g6
+
TI_FLAGS
],
%
l5
andcc
%
l5
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
),
%
g0
andcc
%
l5
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
|
_TIF_SYSCALL_TRACEPOINT
),
%
g0
be
,
pt
%
icc
,
rtrap
nop
call
syscall_trace_leave
...
...
@@ -187,7 +187,7 @@ linux_syscall_trace:
.
globl
linux_sparc_syscall32
linux_sparc_syscall32
:
/
*
Direct
access
to
user
regs
,
much
faster
.
*/
cmp
%
g1
,
NR_
SYSCALLS
!
IEU1
Group
cmp
%
g1
,
NR_
syscalls
!
IEU1
Group
bgeu
,
pn
%
xcc
,
linux_sparc_ni_syscall
!
CTI
srl
%
i0
,
0
,
%
o0
!
IEU0
sll
%
g1
,
2
,
%
l4
!
IEU0
Group
...
...
@@ -198,7 +198,7 @@ linux_sparc_syscall32:
srl
%
i5
,
0
,
%
o5
!
IEU1
srl
%
i2
,
0
,
%
o2
!
IEU0
Group
andcc
%
l0
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
),
%
g0
andcc
%
l0
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
|
_TIF_SYSCALL_TRACEPOINT
),
%
g0
bne
,
pn
%
icc
,
linux_syscall_trace32
!
CTI
mov
%
i0
,
%
l5
!
IEU1
call
%
l7
!
CTI
Group
brk
forced
...
...
@@ -210,7 +210,7 @@ linux_sparc_syscall32:
.
globl
linux_sparc_syscall
linux_sparc_syscall
:
/
*
Direct
access
to
user
regs
,
much
faster
.
*/
cmp
%
g1
,
NR_
SYSCALLS
!
IEU1
Group
cmp
%
g1
,
NR_
syscalls
!
IEU1
Group
bgeu
,
pn
%
xcc
,
linux_sparc_ni_syscall
!
CTI
mov
%
i0
,
%
o0
!
IEU0
sll
%
g1
,
2
,
%
l4
!
IEU0
Group
...
...
@@ -221,7 +221,7 @@ linux_sparc_syscall:
mov
%
i3
,
%
o3
!
IEU1
mov
%
i4
,
%
o4
!
IEU0
Group
andcc
%
l0
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
),
%
g0
andcc
%
l0
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
|
_TIF_SYSCALL_TRACEPOINT
),
%
g0
bne
,
pn
%
icc
,
linux_syscall_trace
!
CTI
Group
mov
%
i0
,
%
l5
!
IEU0
2
:
call
%
l7
!
CTI
Group
brk
forced
...
...
@@ -245,7 +245,7 @@ ret_sys_call:
cmp
%
o0
,
-
ERESTART_RESTARTBLOCK
bgeu
,
pn
%
xcc
,
1
f
andcc
%
l0
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
),
%
l6
andcc
%
l0
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
|
_TIF_SYSCALL_TRACEPOINT
),
%
l6
80
:
/
*
System
call
success
,
clear
Carry
condition
code
.
*/
andn
%
g3
,
%
g2
,
%
g3
...
...
@@ -260,7 +260,7 @@ ret_sys_call:
/
*
System
call
failure
,
set
Carry
condition
code
.
*
Also
,
get
abs
(
errno
)
to
return
to
the
process
.
*/
andcc
%
l0
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
),
%
l6
andcc
%
l0
,
(
_TIF_SYSCALL_TRACE|_TIF_SECCOMP|_TIF_SYSCALL_AUDIT
|
_TIF_SYSCALL_TRACEPOINT
),
%
l6
sub
%
g0
,
%
o0
,
%
o0
or
%
g3
,
%
g2
,
%
g3
stx
%
o0
,
[%
sp
+
PTREGS_OFF
+
PT_V9_I0
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录