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