Skip to content

Commit 96bb153

Browse files
mrutland-armctmarinas
authored andcommitted
arm64: stacktrace: make struct stackframe private to stacktrace.c
Now that arm64 uses arch_stack_walk() consistently, struct stackframe is only used within stacktrace.c. To make it easier to read and maintain this code, it would be nicer if the definition were there too. Move the definition into stacktrace.c. There should be no functional change as a result of this patch. Signed-off-by: Mark Rutland <[email protected]> Cc: Madhavan T. Venkataraman <[email protected]> Cc: Mark Brown <[email protected]> Cc: Will Deacon <[email protected]> Reviewed-by: Madhavan T. Venkataraman <[email protected]> Reviwed-by: Mark Brown <[email protected]> Reviewed-by: Kalesh Singh <[email protected]> for the series. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent cb86a41 commit 96bb153

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

arch/arm64/include/asm/stacktrace.h

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -31,38 +31,6 @@ struct stack_info {
3131
enum stack_type type;
3232
};
3333

34-
/*
35-
* A snapshot of a frame record or fp/lr register values, along with some
36-
* accounting information necessary for robust unwinding.
37-
*
38-
* @fp: The fp value in the frame record (or the real fp)
39-
* @pc: The lr value in the frame record (or the real lr)
40-
*
41-
* @stacks_done: Stacks which have been entirely unwound, for which it is no
42-
* longer valid to unwind to.
43-
*
44-
* @prev_fp: The fp that pointed to this frame record, or a synthetic value
45-
* of 0. This is used to ensure that within a stack, each
46-
* subsequent frame record is at an increasing address.
47-
* @prev_type: The type of stack this frame record was on, or a synthetic
48-
* value of STACK_TYPE_UNKNOWN. This is used to detect a
49-
* transition from one stack to another.
50-
*
51-
* @kr_cur: When KRETPROBES is selected, holds the kretprobe instance
52-
* associated with the most recently encountered replacement lr
53-
* value.
54-
*/
55-
struct stackframe {
56-
unsigned long fp;
57-
unsigned long pc;
58-
DECLARE_BITMAP(stacks_done, __NR_STACK_TYPES);
59-
unsigned long prev_fp;
60-
enum stack_type prev_type;
61-
#ifdef CONFIG_KRETPROBES
62-
struct llist_node *kr_cur;
63-
#endif
64-
};
65-
6634
extern void dump_backtrace(struct pt_regs *regs, struct task_struct *tsk,
6735
const char *loglvl);
6836

arch/arm64/kernel/stacktrace.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,38 @@
1818
#include <asm/stack_pointer.h>
1919
#include <asm/stacktrace.h>
2020

21+
/*
22+
* A snapshot of a frame record or fp/lr register values, along with some
23+
* accounting information necessary for robust unwinding.
24+
*
25+
* @fp: The fp value in the frame record (or the real fp)
26+
* @pc: The lr value in the frame record (or the real lr)
27+
*
28+
* @stacks_done: Stacks which have been entirely unwound, for which it is no
29+
* longer valid to unwind to.
30+
*
31+
* @prev_fp: The fp that pointed to this frame record, or a synthetic value
32+
* of 0. This is used to ensure that within a stack, each
33+
* subsequent frame record is at an increasing address.
34+
* @prev_type: The type of stack this frame record was on, or a synthetic
35+
* value of STACK_TYPE_UNKNOWN. This is used to detect a
36+
* transition from one stack to another.
37+
*
38+
* @kr_cur: When KRETPROBES is selected, holds the kretprobe instance
39+
* associated with the most recently encountered replacement lr
40+
* value.
41+
*/
42+
struct stackframe {
43+
unsigned long fp;
44+
unsigned long pc;
45+
DECLARE_BITMAP(stacks_done, __NR_STACK_TYPES);
46+
unsigned long prev_fp;
47+
enum stack_type prev_type;
48+
#ifdef CONFIG_KRETPROBES
49+
struct llist_node *kr_cur;
50+
#endif
51+
};
52+
2153
static notrace void start_backtrace(struct stackframe *frame, unsigned long fp,
2254
unsigned long pc)
2355
{

0 commit comments

Comments
 (0)