[S390] latencytop s390 support.

Cc: Holger Wolf <wolf@linux.vnet.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by Heiko Carstens and committed by Martin Schwidefsky a3afe70b 67fe9251

+26 -8
+3
arch/s390/Kconfig
··· 16 config STACKTRACE_SUPPORT 17 def_bool y 18 19 config RWSEM_GENERIC_SPINLOCK 20 bool 21
··· 16 config STACKTRACE_SUPPORT 17 def_bool y 18 19 + config HAVE_LATENCYTOP_SUPPORT 20 + def_bool y 21 + 22 config RWSEM_GENERIC_SPINLOCK 23 bool 24
+23 -8
arch/s390/kernel/stacktrace.c
··· 14 static unsigned long save_context_stack(struct stack_trace *trace, 15 unsigned long sp, 16 unsigned long low, 17 - unsigned long high) 18 { 19 struct stack_frame *sf; 20 struct pt_regs *regs; ··· 48 return sp; 49 regs = (struct pt_regs *)sp; 50 addr = regs->psw.addr & PSW_ADDR_INSN; 51 - if (!trace->skip) 52 - trace->entries[trace->nr_entries++] = addr; 53 - else 54 - trace->skip--; 55 if (trace->nr_entries >= trace->max_entries) 56 return sp; 57 low = sp; ··· 69 orig_sp = sp & PSW_ADDR_INSN; 70 new_sp = save_context_stack(trace, orig_sp, 71 S390_lowcore.panic_stack - PAGE_SIZE, 72 - S390_lowcore.panic_stack); 73 if (new_sp != orig_sp) 74 return; 75 new_sp = save_context_stack(trace, new_sp, 76 S390_lowcore.async_stack - ASYNC_SIZE, 77 - S390_lowcore.async_stack); 78 if (new_sp != orig_sp) 79 return; 80 save_context_stack(trace, new_sp, 81 S390_lowcore.thread_info, 82 - S390_lowcore.thread_info + THREAD_SIZE); 83 }
··· 14 static unsigned long save_context_stack(struct stack_trace *trace, 15 unsigned long sp, 16 unsigned long low, 17 + unsigned long high, 18 + int savesched) 19 { 20 struct stack_frame *sf; 21 struct pt_regs *regs; ··· 47 return sp; 48 regs = (struct pt_regs *)sp; 49 addr = regs->psw.addr & PSW_ADDR_INSN; 50 + if (savesched || !in_sched_functions(addr)) { 51 + if (!trace->skip) 52 + trace->entries[trace->nr_entries++] = addr; 53 + else 54 + trace->skip--; 55 + } 56 if (trace->nr_entries >= trace->max_entries) 57 return sp; 58 low = sp; ··· 66 orig_sp = sp & PSW_ADDR_INSN; 67 new_sp = save_context_stack(trace, orig_sp, 68 S390_lowcore.panic_stack - PAGE_SIZE, 69 + S390_lowcore.panic_stack, 1); 70 if (new_sp != orig_sp) 71 return; 72 new_sp = save_context_stack(trace, new_sp, 73 S390_lowcore.async_stack - ASYNC_SIZE, 74 + S390_lowcore.async_stack, 1); 75 if (new_sp != orig_sp) 76 return; 77 save_context_stack(trace, new_sp, 78 S390_lowcore.thread_info, 79 + S390_lowcore.thread_info + THREAD_SIZE, 1); 80 + } 81 + 82 + void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) 83 + { 84 + unsigned long sp, low, high; 85 + 86 + sp = tsk->thread.ksp & PSW_ADDR_INSN; 87 + low = (unsigned long) task_stack_page(tsk); 88 + high = (unsigned long) task_pt_regs(tsk); 89 + save_context_stack(trace, sp, low, high, 0); 90 + if (trace->nr_entries < trace->max_entries) 91 + trace->entries[trace->nr_entries++] = ULONG_MAX; 92 }