diff options
author | Avik Sil <avik.sil@linaro.org> | 2011-03-31 11:06:38 +0000 |
---|---|---|
committer | Avik Sil <avik.sil@linaro.org> | 2011-03-31 11:06:38 +0000 |
commit | ebb688e3183bd5891312bdb8f4e2f520d70b36b6 (patch) | |
tree | c30d1abefaccc8cd1baa4944aae3348668e13bde /arch/powerpc | |
parent | 8061f3a885ec3538bf405ff3957c205b1ab2aae4 (diff) | |
parent | b2afcd30fff4c24290a63a2497de301864d9726d (diff) |
Merge remote branch 'lttng/2.6.38-lttng-0.247'
Conflicts:
arch/arm/kernel/traps.c
arch/arm/mach-omap2/clock34xx.c
arch/arm/mach-omap2/pm34xx.c
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/Kconfig | 2 | ||||
-rw-r--r-- | arch/powerpc/include/asm/thread_info.h | 8 | ||||
-rw-r--r-- | arch/powerpc/include/asm/timex.h | 12 | ||||
-rw-r--r-- | arch/powerpc/include/asm/trace-clock.h | 48 | ||||
-rw-r--r-- | arch/powerpc/include/asm/trace.h | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/irq.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_32.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_64.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/ppc_ksyms.c | 3 | ||||
-rw-r--r-- | arch/powerpc/kernel/process.c | 14 | ||||
-rw-r--r-- | arch/powerpc/kernel/ptrace.c | 8 | ||||
-rw-r--r-- | arch/powerpc/kernel/sys_ppc32.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/time.c | 4 | ||||
-rw-r--r-- | arch/powerpc/kernel/traps.c | 19 | ||||
-rw-r--r-- | arch/powerpc/mm/fault.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/file.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 1 |
17 files changed, 131 insertions, 10 deletions
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 7d69e9bf5e6..b13eeab289a 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -117,11 +117,13 @@ config PPC select HAVE_IOREMAP_PROT select HAVE_EFFICIENT_UNALIGNED_ACCESS select HAVE_KPROBES + select HAVE_TRACE_CLOCK select HAVE_ARCH_KGDB select HAVE_KRETPROBES select HAVE_ARCH_TRACEHOOK select HAVE_MEMBLOCK select HAVE_DMA_ATTRS + select HAVE_GET_CYCLES if PPC64 select HAVE_DMA_API_DEBUG select USE_GENERIC_SMP_HELPERS if SMP select HAVE_OPROFILE diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h index 65eb85976a0..34ba6e0a4d8 100644 --- a/arch/powerpc/include/asm/thread_info.h +++ b/arch/powerpc/include/asm/thread_info.h @@ -100,7 +100,7 @@ static inline struct thread_info *current_thread_info(void) #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */ #define TIF_32BIT 4 /* 32 bit binary */ -#define TIF_PERFMON_WORK 5 /* work for pfm_handle_work() */ +#define TIF_KERNEL_TRACE 5 /* kernel trace active */ #define TIF_PERFMON_CTXSW 6 /* perfmon needs ctxsw calls */ #define TIF_SYSCALL_AUDIT 7 /* syscall auditing active */ #define TIF_SINGLESTEP 8 /* singlestepping active */ @@ -111,6 +111,7 @@ static inline struct thread_info *current_thread_info(void) #define TIF_NOTIFY_RESUME 13 /* callback before returning to user */ #define TIF_FREEZE 14 /* Freezing for suspend */ #define TIF_RUNLATCH 15 /* Is the runlatch enabled? */ +#define TIF_PERFMON_WORK 16 /* work for pfm_handle_work() */ /* as above, but as bit values */ #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) @@ -118,7 +119,7 @@ static inline struct thread_info *current_thread_info(void) #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED) #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) #define _TIF_32BIT (1<<TIF_32BIT) -#define _TIF_PERFMON_WORK (1<<TIF_PERFMON_WORK) +#define _TIF_KERNEL_TRACE (1<<TIF_KERNEL_TRACE) #define _TIF_PERFMON_CTXSW (1<<TIF_PERFMON_CTXSW) #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT) #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP) @@ -128,7 +129,8 @@ static inline struct thread_info *current_thread_info(void) #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME) #define _TIF_FREEZE (1<<TIF_FREEZE) #define _TIF_RUNLATCH (1<<TIF_RUNLATCH) -#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP) +#define _TIF_PERFMON_WORK (1<<TIF_PERFMON_WORK) +#define _TIF_SYSCALL_T_OR_A (_TIF_SYSCALL_TRACE|_TIF_SYSCALL_AUDIT|_TIF_SECCOMP|_TIF_KERNEL_TRACE) #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED | \ _TIF_NOTIFY_RESUME) diff --git a/arch/powerpc/include/asm/timex.h b/arch/powerpc/include/asm/timex.h index c55e14f7ef4..2fe7460cbf9 100644 --- a/arch/powerpc/include/asm/timex.h +++ b/arch/powerpc/include/asm/timex.h @@ -14,6 +14,8 @@ typedef unsigned long cycles_t; +extern unsigned long tb_ticks_per_sec; + static inline cycles_t get_cycles(void) { #ifdef __powerpc64__ @@ -46,5 +48,15 @@ static inline cycles_t get_cycles(void) #endif } +static inline cycles_t get_cycles_rate(void) +{ + return tb_ticks_per_sec; +} + +static inline void get_cycles_barrier(void) +{ + isync(); +} + #endif /* __KERNEL__ */ #endif /* _ASM_POWERPC_TIMEX_H */ diff --git a/arch/powerpc/include/asm/trace-clock.h b/arch/powerpc/include/asm/trace-clock.h new file mode 100644 index 00000000000..05facc3e372 --- /dev/null +++ b/arch/powerpc/include/asm/trace-clock.h @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2005,2008 Mathieu Desnoyers + * + * Trace clock PowerPC definitions. + * + * Use get_tb() directly to insure reading a 64-bits value on powerpc 32. + */ + +#ifndef _ASM_TRACE_CLOCK_H +#define _ASM_TRACE_CLOCK_H + +#include <linux/timex.h> +#include <linux/time.h> +#include <asm/time.h> + +static inline u32 trace_clock_read32(void) +{ + return get_tbl(); +} + +static inline u64 trace_clock_read64(void) +{ + return get_tb(); +} + +static inline unsigned int trace_clock_frequency(void) +{ + return get_cycles_rate(); +} + +static inline u32 trace_clock_freq_scale(void) +{ + return 1; +} + +static inline int get_trace_clock(void) +{ + return 0; +} + +static inline void put_trace_clock(void) +{ +} + +static inline void set_trace_clock_is_sync(int state) +{ +} +#endif /* _ASM_TRACE_CLOCK_H */ diff --git a/arch/powerpc/include/asm/trace.h b/arch/powerpc/include/asm/trace.h index cbe2297d68b..d1c27723f84 100644 --- a/arch/powerpc/include/asm/trace.h +++ b/arch/powerpc/include/asm/trace.h @@ -7,7 +7,7 @@ #include <linux/tracepoint.h> struct pt_regs; - +#if 0 /* disabled by Mathieu Desnoyers. Belongs to generic IRQS. */ TRACE_EVENT(irq_entry, TP_PROTO(struct pt_regs *regs), @@ -41,6 +41,7 @@ TRACE_EVENT(irq_exit, TP_printk("pt_regs=%p", __entry->regs) ); +#endif //0 TRACE_EVENT(timer_interrupt_entry, diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index ce557f6f00f..d21cf5bc503 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c @@ -401,8 +401,6 @@ void do_IRQ(struct pt_regs *regs) struct pt_regs *old_regs = set_irq_regs(regs); unsigned int irq; - trace_irq_entry(regs); - irq_enter(); check_stack_overflow(); @@ -425,8 +423,6 @@ void do_IRQ(struct pt_regs *regs) timer_interrupt(regs); } #endif - - trace_irq_exit(regs); } void __init init_IRQ(void) diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 094bd9821ad..8294f73feac 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S @@ -665,7 +665,7 @@ _GLOBAL(abs) * Create a kernel thread * kernel_thread(fn, arg, flags) */ -_GLOBAL(kernel_thread) +_GLOBAL(original_kernel_thread) stwu r1,-16(r1) stw r30,8(r1) stw r31,12(r1) diff --git a/arch/powerpc/kernel/misc_64.S b/arch/powerpc/kernel/misc_64.S index 206a321a71d..1e10e579922 100644 --- a/arch/powerpc/kernel/misc_64.S +++ b/arch/powerpc/kernel/misc_64.S @@ -415,7 +415,7 @@ _GLOBAL(scom970_write) * Create a kernel thread * kernel_thread(fn, arg, flags) */ -_GLOBAL(kernel_thread) +_GLOBAL(original_kernel_thread) std r29,-24(r1) std r30,-16(r1) stdu r1,-STACK_FRAME_OVERHEAD(r1) diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index ef3ef566235..046b16e4a57 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c @@ -161,6 +161,9 @@ EXPORT_SYMBOL(screen_info); #ifdef CONFIG_PPC32 EXPORT_SYMBOL(timer_interrupt); +#ifndef CONFIG_SPARSE_IRQ +EXPORT_SYMBOL(irq_desc); +#endif EXPORT_SYMBOL(tb_ticks_per_jiffy); EXPORT_SYMBOL(cacheable_memcpy); EXPORT_SYMBOL(cacheable_memzero); diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 8303a6c65ef..0a85886a784 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -38,6 +38,7 @@ #include <linux/personality.h> #include <linux/random.h> #include <linux/hw_breakpoint.h> +#include <trace/sched.h> #include <asm/pgtable.h> #include <asm/uaccess.h> @@ -55,6 +56,8 @@ #include <linux/kprobes.h> #include <linux/kdebug.h> +DEFINE_TRACE(sched_kthread_create); + extern unsigned long _get_SP(void); #ifndef CONFIG_SMP @@ -663,6 +666,17 @@ void show_regs(struct pt_regs * regs) show_instructions(regs); } +long original_kernel_thread(int (*fn) (void *), void *arg, unsigned long flags); + +long kernel_thread(int (fn) (void *), void *arg, unsigned long flags) +{ + long retval; + + retval = original_kernel_thread(fn, arg, flags); + trace_sched_kthread_create(fn, retval); + return retval; +} + void exit_thread(void) { discard_lazy_cpu_state(); diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c index 90653699829..fb8924c5fdf 100644 --- a/arch/powerpc/kernel/ptrace.c +++ b/arch/powerpc/kernel/ptrace.c @@ -34,12 +34,16 @@ #endif #include <linux/hw_breakpoint.h> #include <linux/perf_event.h> +#include <trace/syscall.h> #include <asm/uaccess.h> #include <asm/page.h> #include <asm/pgtable.h> #include <asm/system.h> +DEFINE_TRACE(syscall_entry); +DEFINE_TRACE(syscall_exit); + /* * The parameter save area on the stack is used to store arguments being passed * to callee function and is located at fixed offset from stack pointer. @@ -1680,6 +1684,8 @@ long do_syscall_trace_enter(struct pt_regs *regs) { long ret = 0; + trace_syscall_entry(regs, regs->gpr[0]); + secure_computing(regs->gpr[0]); if (test_thread_flag(TIF_SYSCALL_TRACE) && @@ -1715,6 +1721,8 @@ void do_syscall_trace_leave(struct pt_regs *regs) { int step; + trace_syscall_exit(regs->result); + if (unlikely(current->audit_context)) audit_syscall_exit((regs->ccr&0x10000000)?AUDITSC_FAILURE:AUDITSC_SUCCESS, regs->result); diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index 4e5bf1edc0f..5fe3cb1f38b 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c @@ -41,6 +41,7 @@ #include <linux/elf.h> #include <linux/ipc.h> #include <linux/slab.h> +#include <trace/ipc.h> #include <asm/ptrace.h> #include <asm/types.h> @@ -51,6 +52,7 @@ #include <asm/ppc-pci.h> #include <asm/syscalls.h> +DEFINE_TRACE(ipc_call); asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, compat_ulong_t __user *outp, compat_ulong_t __user *exp, @@ -79,6 +81,8 @@ long compat_sys_ipc(u32 call, u32 first, u32 second, u32 third, compat_uptr_t pt version = call >> 16; /* hack for backward compatibility */ call &= 0xffff; + trace_ipc_call(call, first); + switch (call) { case SEMTIMEDOP: diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 09d31dbf43f..fcbe3f5c074 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c @@ -54,6 +54,7 @@ #include <linux/irq.h> #include <linux/delay.h> #include <linux/irq_work.h> +#include <trace/trap.h> #include <asm/trace.h> #include <asm/io.h> @@ -585,6 +586,8 @@ void timer_interrupt(struct pt_regs * regs) * some CPUs will continuue to take decrementer exceptions */ set_dec(DECREMENTER_MAX); + trace_trap_entry(regs, regs->trap); + #if defined(CONFIG_PPC32) && defined(CONFIG_PMAC) if (atomic_read(&ppc_n_lost_interrupts) != 0) do_IRQ(regs); @@ -631,6 +634,7 @@ void timer_interrupt(struct pt_regs * regs) set_irq_regs(old_regs); trace_timer_interrupt_exit(regs); + trace_trap_exit(); } #ifdef CONFIG_SUSPEND diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index bd74fac169b..62ae8cad792 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -34,6 +34,8 @@ #include <linux/bug.h> #include <linux/kdebug.h> #include <linux/debugfs.h> +#include <linux/ltt-core.h> +#include <trace/trap.h> #include <asm/emulated_ops.h> #include <asm/pgtable.h> @@ -75,6 +77,12 @@ EXPORT_SYMBOL(__debugger_fault_handler); #endif /* + * Also used in time.c and fault.c. + */ +DEFINE_TRACE(trap_entry); +DEFINE_TRACE(trap_exit); + +/* * Trap & Exception support */ @@ -141,6 +149,10 @@ int die(const char *str, struct pt_regs *regs, long err) #ifdef CONFIG_NUMA printk("NUMA "); #endif +#ifdef CONFIG_LTT + printk("LTT NESTING LEVEL : %u ", __get_cpu_var(ltt_nesting)); + printk("\n"); +#endif printk("%s\n", ppc_md.name ? ppc_md.name : ""); sysfs_printk_last_file(); @@ -204,11 +216,14 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr) addr, regs->nip, regs->link, code); } + trace_trap_entry(regs, regs->trap); + memset(&info, 0, sizeof(info)); info.si_signo = signr; info.si_code = code; info.si_addr = (void __user *) addr; force_sig_info(signr, &info, current); + trace_trap_exit(); } #ifdef CONFIG_PPC64 @@ -1087,7 +1102,9 @@ void performance_monitor_exception(struct pt_regs *regs) { __get_cpu_var(irq_stat).pmu_irqs++; + trace_trap_entry(regs, regs->trap); perf_irq(regs); + trace_trap_exit(); } #ifdef CONFIG_8xx @@ -1308,12 +1325,14 @@ void altivec_assist_exception(struct pt_regs *regs) /* got an error reading the instruction */ _exception(SIGSEGV, regs, SEGV_ACCERR, regs->nip); } else { + trace_trap_entry(regs, regs->trap); /* didn't recognize the instruction */ /* XXX quick hack for now: set the non-Java bit in the VSCR */ if (printk_ratelimit()) printk(KERN_ERR "Unrecognized altivec instruction " "in %s at %lx\n", current->comm, regs->nip); current->thread.vscr.u[3] |= 0x10000; + trace_trap_exit(); } } #endif /* CONFIG_ALTIVEC */ diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c index 54f4fb994e9..2fb3d0ce222 100644 --- a/arch/powerpc/mm/fault.c +++ b/arch/powerpc/mm/fault.c @@ -31,6 +31,7 @@ #include <linux/kdebug.h> #include <linux/perf_event.h> #include <linux/magic.h> +#include <trace/fault.h> #include <asm/firmware.h> #include <asm/page.h> @@ -43,6 +44,9 @@ #include <asm/siginfo.h> #include <mm/mmu_decl.h> +DEFINE_TRACE(page_fault_entry); +DEFINE_TRACE(page_fault_exit); + #ifdef CONFIG_KPROBES static inline int notify_page_fault(struct pt_regs *regs) { @@ -309,7 +313,9 @@ good_area: * make sure we exit gracefully rather than endlessly redo * the fault. */ + trace_page_fault_entry(regs, regs->trap, mm, vma, address, is_write); ret = handle_mm_fault(mm, vma, address, is_write ? FAULT_FLAG_WRITE : 0); + trace_page_fault_exit(ret); if (unlikely(ret & VM_FAULT_ERROR)) { if (ret & VM_FAULT_OOM) goto out_of_memory; diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 3c7c3f82d84..3f098525259 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c @@ -30,6 +30,7 @@ #include <linux/ptrace.h> #include <linux/seq_file.h> #include <linux/slab.h> +#include <linux/marker.h> #include <asm/io.h> #include <asm/time.h> diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 0b046628493..a7b4b883863 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c @@ -40,6 +40,7 @@ #include <linux/pid_namespace.h> #include <linux/proc_fs.h> #include <linux/seq_file.h> +#include <linux/marker.h> #include <asm/io.h> #include <asm/mmu_context.h> |