Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
1c133b4b
Commit
1c133b4b
authored
Jul 27, 2008
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sparc: Use tracehook routines in syscall_trace().
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
76822586
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
17 deletions
+21
-17
arch/sparc/kernel/entry.S
arch/sparc/kernel/entry.S
+10
-2
arch/sparc/kernel/ptrace.c
arch/sparc/kernel/ptrace.c
+11
-15
No files found.
arch/sparc/kernel/entry.S
View file @
1c133b4b
...
...
@@ -1196,8 +1196,9 @@ sys_rt_sigreturn:
be
1
f
nop
add
%
sp
,
STACKFRAME_SZ
,
%
o0
call
syscall_trace
nop
mov
1
,
%
o1
1
:
/
*
We
are
returning
to
a
signal
handler
.
*/
...
...
@@ -1287,8 +1288,12 @@ linux_fast_syscall:
mov
%
i3
,
%
o3
linux_syscall_trace
:
add
%
sp
,
STACKFRAME_SZ
,
%
o0
call
syscall_trace
nop
mov
0
,
%
o1
cmp
%
o0
,
0
bne
3
f
mov
-
ENOSYS
,
%
o0
mov
%
i0
,
%
o0
mov
%
i1
,
%
o1
mov
%
i2
,
%
o2
...
...
@@ -1337,6 +1342,7 @@ syscall_is_too_hard:
call
%
l7
mov
%
i5
,
%
o5
3
:
st
%
o0
,
[%
sp
+
STACKFRAME_SZ
+
PT_I0
]
ret_sys_call
:
...
...
@@ -1374,6 +1380,8 @@ ret_sys_call:
st
%
l2
,
[%
sp
+
STACKFRAME_SZ
+
PT_NPC
]
linux_syscall_trace2
:
add
%
sp
,
STACKFRAME_SZ
,
%
o0
mov
1
,
%
o1
call
syscall_trace
add
%
l1
,
0x4
,
%
l2
/*
npc
=
npc
+
4
*/
st
%
l1
,
[%
sp
+
STACKFRAME_SZ
+
PT_PC
]
...
...
arch/sparc/kernel/ptrace.c
View file @
1c133b4b
...
...
@@ -21,6 +21,7 @@
#include <linux/signal.h>
#include <linux/regset.h>
#include <linux/elf.h>
#include <linux/tracehook.h>
#include <asm/pgtable.h>
#include <asm/system.h>
...
...
@@ -450,21 +451,16 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data)
return
ret
;
}
asmlinkage
void
syscall_trace
(
void
)
asmlinkage
int
syscall_trace
(
struct
pt_regs
*
regs
,
int
syscall_exit_p
)
{
if
(
!
test_thread_flag
(
TIF_SYSCALL_TRACE
))
return
;
if
(
!
(
current
->
ptrace
&
PT_PTRACED
))
return
;
ptrace_notify
(
SIGTRAP
|
((
current
->
ptrace
&
PT_TRACESYSGOOD
)
?
0x80
:
0
));
/*
* this isn't the same as continuing with a signal, but it will do
* for normal use. strace only continues with a signal if the
* stopping signal is not SIGTRAP. -brl
*/
if
(
current
->
exit_code
)
{
send_sig
(
current
->
exit_code
,
current
,
1
);
current
->
exit_code
=
0
;
int
ret
=
0
;
if
(
test_thread_flag
(
TIF_SYSCALL_TRACE
))
{
if
(
syscall_exit_p
)
tracehook_report_syscall_exit
(
regs
,
0
);
else
ret
=
tracehook_report_syscall_entry
(
regs
);
}
return
ret
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment