fs/reiserfs/journal.c: change return type of dirty_one_transaction
[linux/fpc-iii.git] / arch / s390 / kernel / stacktrace.c
blobf6a620f854e168b733ee73f7f6eeda0910317f7d
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Stack trace management functions
5 * Copyright IBM Corp. 2006
6 * Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
7 */
9 #include <linux/sched.h>
10 #include <linux/sched/debug.h>
11 #include <linux/stacktrace.h>
12 #include <linux/kallsyms.h>
13 #include <linux/export.h>
14 #include <asm/stacktrace.h>
15 #include <asm/unwind.h>
17 void save_stack_trace(struct stack_trace *trace)
19 struct unwind_state state;
21 unwind_for_each_frame(&state, current, NULL, 0) {
22 if (trace->nr_entries >= trace->max_entries)
23 break;
24 if (trace->skip > 0)
25 trace->skip--;
26 else
27 trace->entries[trace->nr_entries++] = state.ip;
30 EXPORT_SYMBOL_GPL(save_stack_trace);
32 void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace)
34 struct unwind_state state;
36 unwind_for_each_frame(&state, tsk, NULL, 0) {
37 if (trace->nr_entries >= trace->max_entries)
38 break;
39 if (in_sched_functions(state.ip))
40 continue;
41 if (trace->skip > 0)
42 trace->skip--;
43 else
44 trace->entries[trace->nr_entries++] = state.ip;
47 EXPORT_SYMBOL_GPL(save_stack_trace_tsk);
49 void save_stack_trace_regs(struct pt_regs *regs, struct stack_trace *trace)
51 struct unwind_state state;
53 unwind_for_each_frame(&state, current, regs, 0) {
54 if (trace->nr_entries >= trace->max_entries)
55 break;
56 if (trace->skip > 0)
57 trace->skip--;
58 else
59 trace->entries[trace->nr_entries++] = state.ip;
62 EXPORT_SYMBOL_GPL(save_stack_trace_regs);