LTT for 2.5.37 6/9: S/390 trace support
Subsystems (3)
PATCH 1/1 LTT for 2.5.37 6/9: S/390 trace support
This patch adds S/390 trace support.
Here are the file modifications:
arch/s390/config.in | 2 arch/s390/kernel/entry.S | 18 ++++++ arch/s390/kernel/process.c | 5 + arch/s390/kernel/sys_s390.c | 3 + arch/s390/kernel/traps.c | 117 ++++++++++++++++++++++++++++++++++++++++++++ arch/s390/mm/fault.c | 12 ++++ drivers/s390/cio/cio.c | 4 + drivers/s390/s390mach.c | 12 ++++ include/asm-s390/trace.h | 15 +++++ 9 files changed, 188 insertions
arch/s390/config.in +2 -0
@@ -65,6 +65,8 @@ fi source fs/Config.in +source drivers/trace/Config.in + mainmenu_option next_comment comment 'Kernel hacking'
arch/s390/kernel/entry.S +18 -0
@@ -7,6 +7,7 @@ * Author(s): Martin Schwidefsky ([email protected]), * Hartmut Penner ([email protected]), * Denis Joseph Barrow ([email protected],[email protected]), + * Portions added by T. Halloran: (C) Copyright 2002 IBM Poughkeepsie, IBM Corporation */ #include <linux/sys.h>
@@ -183,6 +184,14 @@ system_call: sll %r8,2 GET_THREAD_INFO # load pointer to task_struct to R9 stosm 24(%r15),0x03 # reenable interrupts +/* call to ltt trace done here. R8 has the syscall (svc) number to trace */ +#if (CONFIG_TRACE || CONFIG_TRACE_MODULE) /* tjh - ltt port */ + /* add call to trace_real_syscall_entry */ + la %r2,SP_PTREGS(%r15) # load pt_regs as first parameter + l %r1,BASED(.Ltracesysent) + basr %r14,%r1 + lm %r0,%r6,SP_R0(%r15) /* restore call clobbered regs tjh */ +#endif l %r8,sys_call_table-entry_base(%r8,%r13) # get system call addr. tm __TI_flags+3(%r9),_TIF_SYSCALL_TRACE bo BASED(sysc_tracesys)
@@ -191,6 +200,13 @@ system_call: # ATTENTION: check sys_execve_glue before # changing anything here !! +#if (CONFIG_TRACE || CONFIG_TRACE_MODULE) /* tjh - ltt port * + /* add call to trace_real_syscall_exit */ + la %r2,SP_PTREGS(%r15) # load pt_regs as first parameter + l %r1,BASED(.Ltracesysext) + basr %r14,%r1 + lm %r0,%r6,SP_R0(%r15) /* restore call clobbered regs */ +#endif sysc_return: stnsm 24(%r15),0xfc # disable I/O and ext. interrupts tm __TI_flags+3(%r9),_TIF_WORK_MASK
@@ -896,6 +912,8 @@ restart_go: .Lsigaltstack: .long sys_sigaltstack .Ltrace: .long syscall_trace .Lvfork: .long sys_vfork +.Ltracesysent: .long trace_real_syscall_entry +.Ltracesysext: .long trace_real_syscall_exit #ifdef CONFIG_SMP .Lschedtail: .long schedule_tail #endif
arch/s390/kernel/process.c +5 -0
@@ -36,6 +36,7 @@#include <linux/delay.h> #include <linux/reboot.h> #include <linux/init.h> +#include <linux/trace.h> #include <asm/uaccess.h> #include <asm/pgtable.h>
@@ -145,6 +146,10 @@ int kernel_thread(int (*fn)(void *), voi : "d" (clone_arg), "i" (__NR_clone), "i" (__NR_exit), "d" (arg), "d" (fn), "i" (__LC_KERNEL_STACK) , "i" (-STACK_FRAME_OVERHEAD) : "2", "3", "4" ); +#if (CONFIG_TRACE ||CONFIG_TRACE_MODULE ) +if (retval >0 ) +TRACE_PROCESS (TRACE_EV_PROCESS_KTHREAD , retval, (int ) fn); +#endif return retval; }
arch/s390/kernel/sys_s390.c +3 -0
@@ -24,6 +24,7 @@#include <linux/mman.h> #include <linux/file.h> #include <linux/utsname.h> +#include <linux/trace.h> #include <asm/uaccess.h> #include <asm/ipc.h>
@@ -144,6 +145,8 @@ asmlinkage int sys_ipc (uint call, int f {struct ipc_kludge tmp;int ret; + +TRACE_IPC (TRACE_EV_IPC_CALL , call, first);switch (call) {case SEMOP :
arch/s390/kernel/traps.c +117 -0
212 lines not on this page · raw message
arch/s390/mm/fault.c +12 -0
@@ -5,6 +5,7 @@* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Hartmut Penner ([email protected]) * Ulrich Weigand ([email protected]) +* Portions added by T. Halloran: (C) Copyright 2002 IBM Poughkeepsie, IBM Corporation * * Derived from "arch/i386/mm/fault.c" * Copyright (C) 1995 Linus Torvalds
@@ -25,6 +26,7 @@#include <linux/compatmac.h> #include <linux/init.h> #include <linux/console.h> +#include <linux/trace.h> #include <asm/system.h> #include <asm/uaccess.h>
@@ -154,6 +156,8 @@ extern inline void do_exception(struct pint user_address;unsigned long fixup;int si_code =SEGV_MAPERR ; +trapid_t ltt_interruption_code; +char * ic_ptr = (char *) <t_interruption_code; tsk = current; mm = tsk->mm;
@@ -201,6 +205,9 @@ extern inline void do_exception(struct p*/ local_irq_enable (); +memset (<t_interruption_code,0 ,sizeof (ltt_interruption_code)); +memcpy (ic_ptr+4 ,&error_code,sizeof (error_code)); +TRACE_TRAP_ENTRY (ltt_interruption_code,(regs->psw.addr &PSW_ADDR_MASK ));down_read (&mm->mmap_sem); vma =find_vma (mm, address);
@@ -247,6 +254,7 @@ survive: }up_read (&mm->mmap_sem); +TRACE_TRAP_EXIT ();return ;/*
@@ -261,6 +269,7 @@ bad_area: tsk->thread.prot_addr = address; tsk->thread.trap_no = error_code;force_sigsegv (regs, error_code, si_code, address); +TRACE_TRAP_EXIT ();return ; }
@@ -268,6 +277,7 @@ no_context:/* Are we prepared to handle this kernel fault? */ if ((fixup =search_exception_table (regs->psw.addr)) !=0 ) { regs->psw.addr = fixup; +TRACE_TRAP_EXIT ();return ; }
@@ -315,6 +325,8 @@ do_sigbus:/* Kernel mode? Handle exceptions or die */ if (!(regs->psw.mask &PSW_PROBLEM_STATE )) goto no_context; + +TRACE_TRAP_EXIT (); }void do_protection_exception (struct pt_regs *regs,unsigned long error_code)
drivers/s390/cio/cio.c +4 -0
@@ -18,6 +18,8 @@#include <linux/config.h> #include <linux/slab.h> +#include <linux/trace.h> +#include <asm/io.h> #include <asm/irq.h> #include <asm/delay.h>
@@ -1002,9 +1004,11 @@ do_IRQ (struct pt_regs regs) }irq_enter (cpu, irq); +TRACE_IRQ_ENTRY (irq, !(((regs).psw.mask&PSW_PROBLEM_STATE ) !=0 ));s390irq_spin_lock (irq);s390_process_IRQ (irq);s390irq_spin_unlock (irq); +TRACE_IRQ_EXIT ();irq_exit (cpu, irq); }
drivers/s390/s390mach.c +12 -0
@@ -5,12 +5,14 @@* S390 version * Copyright (C) 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation * Author(s): Ingo Adlung ([email protected]) +* Portions added by T. Halloran: (C) Copyright 2002 IBM Poughkeepsie, IBM Corporation */ #include <linux/config.h> #include <linux/spinlock.h> #include <linux/init.h> #include <linux/slab.h> +#include <linux/trace.h> #ifdef CONFIG_SMP #include <linux/smp.h> #endif
@@ -152,10 +154,20 @@ s390_do_machine_check(void) {int crw_count;mcic_t mcic; +trapid_t ltt_interruption_code; +uint32_t ltt_old_psw;DBG (KERN_INFO "s390_do_machine_check : starting ...\n" );memcpy (&mcic, &S390_lowcore.mcck_interruption_code,sizeof (__u64)); +memcpy ( <t_interruption_code, + &S390_lowcore.mcck_interruption_code, +sizeof (__u64)); +memcpy ( <t_old_psw, + &S390_lowcore.mcck_old_psw, +sizeof (uint32_t )); + ltt_old_psw &=PSW_ADDR_MASK ; +TRACE_TRAP_ENTRY (ltt_interruption_code,ltt_old_psw);if (mcic.mcc.mcd.sd)/* system damage */ s390_handle_damage ("received system damage machine check\n" );
include/asm-s390/trace.h +15 -0
@@ -0,0 +1,15 @@ +/* +* linux/include/asm-s390/trace.h +* +* Copyright (C) 2002, Karim Yaghmour +* +* S/390 definitions for tracing system +*/ + +#include <linux/trace.h> + +/* Current arch type */ +#define TRACE_ARCH_TYPE TRACE_ARCH_TYPE_S390 + +/* Current variant type */ +#define TRACE_ARCH_VARIANT TRACE_ARCH_VARIANT_NONE