Commit a4bcbe6a authored by Michael Ellerman's avatar Michael Ellerman

powerpc: Remove old compile time disabled syscall tracing code

We have code to do syscall tracing which is disabled at compile time by
default. It's not been touched since the dawn of time (ie. v2.6.12).

There are now better ways to do syscall tracing, ie. using the
raw_syscall, or syscall tracepoints.

For the specific case of tracing syscalls at boot on a system that
doesn't get to userspace, you can boot with:

  trace_event=syscalls tp_printk=on

Which will trace syscalls from boot, and echo all output to the console.
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 4c3b2168
...@@ -33,9 +33,6 @@ ...@@ -33,9 +33,6 @@
#include <asm/ftrace.h> #include <asm/ftrace.h>
#include <asm/ptrace.h> #include <asm/ptrace.h>
#undef SHOW_SYSCALLS
#undef SHOW_SYSCALLS_TASK
/* /*
* MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE. * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE.
*/ */
...@@ -307,9 +304,6 @@ _GLOBAL(DoSyscall) ...@@ -307,9 +304,6 @@ _GLOBAL(DoSyscall)
lwz r11,_CCR(r1) /* Clear SO bit in CR */ lwz r11,_CCR(r1) /* Clear SO bit in CR */
rlwinm r11,r11,0,4,2 rlwinm r11,r11,0,4,2
stw r11,_CCR(r1) stw r11,_CCR(r1)
#ifdef SHOW_SYSCALLS
bl do_show_syscall
#endif /* SHOW_SYSCALLS */
#ifdef CONFIG_TRACE_IRQFLAGS #ifdef CONFIG_TRACE_IRQFLAGS
/* Return from syscalls can (and generally will) hard enable /* Return from syscalls can (and generally will) hard enable
* interrupts. You aren't supposed to call a syscall with * interrupts. You aren't supposed to call a syscall with
...@@ -352,9 +346,6 @@ syscall_dotrace_cont: ...@@ -352,9 +346,6 @@ syscall_dotrace_cont:
blrl /* Call handler */ blrl /* Call handler */
.globl ret_from_syscall .globl ret_from_syscall
ret_from_syscall: ret_from_syscall:
#ifdef SHOW_SYSCALLS
bl do_show_syscall_exit
#endif
mr r6,r3 mr r6,r3
CURRENT_THREAD_INFO(r12, r1) CURRENT_THREAD_INFO(r12, r1)
/* disable interrupts so current_thread_info()->flags can't change */ /* disable interrupts so current_thread_info()->flags can't change */
...@@ -523,74 +514,6 @@ syscall_exit_work: ...@@ -523,74 +514,6 @@ syscall_exit_work:
bl do_syscall_trace_leave bl do_syscall_trace_leave
b ret_from_except_full b ret_from_except_full
#ifdef SHOW_SYSCALLS
do_show_syscall:
#ifdef SHOW_SYSCALLS_TASK
lis r11,show_syscalls_task@ha
lwz r11,show_syscalls_task@l(r11)
cmp 0,r2,r11
bnelr
#endif
stw r31,GPR31(r1)
mflr r31
lis r3,7f@ha
addi r3,r3,7f@l
lwz r4,GPR0(r1)
lwz r5,GPR3(r1)
lwz r6,GPR4(r1)
lwz r7,GPR5(r1)
lwz r8,GPR6(r1)
lwz r9,GPR7(r1)
bl printk
lis r3,77f@ha
addi r3,r3,77f@l
lwz r4,GPR8(r1)
mr r5,r2
bl printk
lwz r0,GPR0(r1)
lwz r3,GPR3(r1)
lwz r4,GPR4(r1)
lwz r5,GPR5(r1)
lwz r6,GPR6(r1)
lwz r7,GPR7(r1)
lwz r8,GPR8(r1)
mtlr r31
lwz r31,GPR31(r1)
blr
do_show_syscall_exit:
#ifdef SHOW_SYSCALLS_TASK
lis r11,show_syscalls_task@ha
lwz r11,show_syscalls_task@l(r11)
cmp 0,r2,r11
bnelr
#endif
stw r31,GPR31(r1)
mflr r31
stw r3,RESULT(r1) /* Save result */
mr r4,r3
lis r3,79f@ha
addi r3,r3,79f@l
bl printk
lwz r3,RESULT(r1)
mtlr r31
lwz r31,GPR31(r1)
blr
7: .string "syscall %d(%x, %x, %x, %x, %x, "
77: .string "%x), current=%p\n"
79: .string " -> %x\n"
.align 2,0
#ifdef SHOW_SYSCALLS_TASK
.data
.globl show_syscalls_task
show_syscalls_task:
.long -1
.text
#endif
#endif /* SHOW_SYSCALLS */
/* /*
* The fork/clone functions need to copy the full register set into * The fork/clone functions need to copy the full register set into
* the child process. Therefore we need to save all the nonvolatile * the child process. Therefore we need to save all the nonvolatile
......
...@@ -49,8 +49,6 @@ exception_marker: ...@@ -49,8 +49,6 @@ exception_marker:
.section ".text" .section ".text"
.align 7 .align 7
#undef SHOW_SYSCALLS
.globl system_call_common .globl system_call_common
system_call_common: system_call_common:
andi. r10,r12,MSR_PR andi. r10,r12,MSR_PR
...@@ -142,13 +140,6 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR) ...@@ -142,13 +140,6 @@ END_FW_FTR_SECTION_IFSET(FW_FEATURE_SPLPAR)
li r10,1 li r10,1
std r10,SOFTE(r1) std r10,SOFTE(r1)
#ifdef SHOW_SYSCALLS
bl do_show_syscall
REST_GPR(0,r1)
REST_4GPRS(3,r1)
REST_2GPRS(7,r1)
addi r9,r1,STACK_FRAME_OVERHEAD
#endif
CURRENT_THREAD_INFO(r11, r1) CURRENT_THREAD_INFO(r11, r1)
ld r10,TI_FLAGS(r11) ld r10,TI_FLAGS(r11)
andi. r11,r10,_TIF_SYSCALL_DOTRACE andi. r11,r10,_TIF_SYSCALL_DOTRACE
...@@ -180,10 +171,6 @@ system_call: /* label this so stack traces look sane */ ...@@ -180,10 +171,6 @@ system_call: /* label this so stack traces look sane */
.Lsyscall_exit: .Lsyscall_exit:
std r3,RESULT(r1) std r3,RESULT(r1)
#ifdef SHOW_SYSCALLS
bl do_show_syscall_exit
ld r3,RESULT(r1)
#endif
CURRENT_THREAD_INFO(r12, r1) CURRENT_THREAD_INFO(r12, r1)
ld r8,_MSR(r1) ld r8,_MSR(r1)
......
...@@ -121,17 +121,3 @@ long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low, ...@@ -121,17 +121,3 @@ long ppc_fadvise64_64(int fd, int advice, u32 offset_high, u32 offset_low,
return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low, return sys_fadvise64(fd, (u64)offset_high << 32 | offset_low,
(u64)len_high << 32 | len_low, advice); (u64)len_high << 32 | len_low, advice);
} }
void do_show_syscall(unsigned long r3, unsigned long r4, unsigned long r5,
unsigned long r6, unsigned long r7, unsigned long r8,
struct pt_regs *regs)
{
printk("syscall %ld(%lx, %lx, %lx, %lx, %lx, %lx) regs=%p current=%p"
" cpu=%d\n", regs->gpr[0], r3, r4, r5, r6, r7, r8, regs,
current, smp_processor_id());
}
void do_show_syscall_exit(unsigned long r3)
{
printk(" -> %lx, current=%p cpu=%d\n", r3, current, smp_processor_id());
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment