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
nexedi
linux
Commits
12f79be9
Commit
12f79be9
authored
May 26, 2012
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
alpha: don't open-code trace_report_syscall_{enter,exit}
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
3cffdc8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
26 deletions
+19
-26
arch/alpha/kernel/entry.S
arch/alpha/kernel/entry.S
+6
-7
arch/alpha/kernel/ptrace.c
arch/alpha/kernel/ptrace.c
+13
-19
No files found.
arch/alpha/kernel/entry.S
View file @
12f79be9
...
...
@@ -418,11 +418,10 @@ $work_notifysig:
strace
:
/
*
set
up
signal
stack
,
call
syscall_trace
*/
bsr
$
1
,
do_switch_stack
jsr
$
26
,
syscall_trace
jsr
$
26
,
syscall_trace
_enter
/*
returns
the
syscall
number
*/
bsr
$
1
,
undo_switch_stack
/
*
get
the
system
call
number
and
the
arguments
back
..
*/
ldq
$
0
,
0
(
$sp
)
/
*
get
the
arguments
back
..
*/
ldq
$
16
,
SP_OFF
+
24
(
$sp
)
ldq
$
17
,
SP_OFF
+
32
(
$sp
)
ldq
$
18
,
SP_OFF
+
40
(
$sp
)
...
...
@@ -449,7 +448,7 @@ $strace_success:
stq
$
0
,
0
(
$sp
)
/*
save
return
value
*/
bsr
$
1
,
do_switch_stack
jsr
$
26
,
syscall_trace
jsr
$
26
,
syscall_trace
_leave
bsr
$
1
,
undo_switch_stack
br
$
31
,
ret_from_sys_call
...
...
@@ -467,7 +466,7 @@ $strace_error:
bsr
$
1
,
do_switch_stack
mov
$
19
,
$
9
/*
save
old
syscall
number
*/
mov
$
20
,
$
10
/*
save
old
a3
*/
jsr
$
26
,
syscall_trace
jsr
$
26
,
syscall_trace
_leave
mov
$
9
,
$
19
mov
$
10
,
$
20
bsr
$
1
,
undo_switch_stack
...
...
@@ -698,7 +697,7 @@ sys_sigreturn:
lda
$sp
,
-
SWITCH_STACK_SIZE
(
$sp
)
jsr
$
26
,
do_sigreturn
bne
$
9
,
1
f
jsr
$
26
,
syscall_trace
jsr
$
26
,
syscall_trace
_leave
1
:
br
$
1
,
undo_switch_stack
br
ret_from_sys_call
.
end
sys_sigreturn
...
...
@@ -715,7 +714,7 @@ sys_rt_sigreturn:
lda
$sp
,
-
SWITCH_STACK_SIZE
(
$sp
)
jsr
$
26
,
do_rt_sigreturn
bne
$
9
,
1
f
jsr
$
26
,
syscall_trace
jsr
$
26
,
syscall_trace
_leave
1
:
br
$
1
,
undo_switch_stack
br
ret_from_sys_call
.
end
sys_rt_sigreturn
...
...
arch/alpha/kernel/ptrace.c
View file @
12f79be9
...
...
@@ -13,6 +13,7 @@
#include <linux/user.h>
#include <linux/security.h>
#include <linux/signal.h>
#include <linux/tracehook.h>
#include <asm/uaccess.h>
#include <asm/pgtable.h>
...
...
@@ -312,25 +313,18 @@ long arch_ptrace(struct task_struct *child, long request,
return
ret
;
}
asmlinkage
unsigned
long
syscall_trace_enter
(
void
)
{
unsigned
long
ret
=
0
;
if
(
test_thread_flag
(
TIF_SYSCALL_TRACE
)
&&
tracehook_report_syscall_entry
(
current_pt_regs
()))
ret
=
-
1UL
;
return
ret
?:
current_pt_regs
()
->
r0
;
}
asmlinkage
void
syscall_trace
(
void
)
syscall_trace
_leave
(
void
)
{
if
(
!
test_thread_flag
(
TIF_SYSCALL_TRACE
))
return
;
if
(
!
(
current
->
ptrace
&
PT_PTRACED
))
return
;
/* The 0x80 provides a way for the tracing parent to distinguish
between a syscall stop and SIGTRAP delivery */
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
;
}
if
(
test_thread_flag
(
TIF_SYSCALL_TRACE
))
tracehook_report_syscall_exit
(
current_pt_regs
(),
0
);
}
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