Skip to content

Commit c797bd4

Browse files
madvenka786ctmarinas
authored andcommitted
arm64: stacktrace: rename unwinder functions
Rename unwinder functions for consistency and better naming. - Rename start_backtrace() to unwind_init(). - Rename unwind_frame() to unwind_next(). - Rename walk_stackframe() to unwind(). There should be no functional change as a result of this patch. Signed-off-by: Madhavan T. Venkataraman <[email protected]> Reviewed-by: Mark Brown <[email protected]> Signed-off-by: Mark Rutland <[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 96bb153 commit c797bd4

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

arch/arm64/kernel/stacktrace.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ struct stackframe {
5050
#endif
5151
};
5252

53-
static notrace void start_backtrace(struct stackframe *frame, unsigned long fp,
54-
unsigned long pc)
53+
static notrace void unwind_init(struct stackframe *frame, unsigned long fp,
54+
unsigned long pc)
5555
{
5656
frame->fp = fp;
5757
frame->pc = pc;
@@ -62,7 +62,7 @@ static notrace void start_backtrace(struct stackframe *frame, unsigned long fp,
6262
/*
6363
* Prime the first unwind.
6464
*
65-
* In unwind_frame() we'll check that the FP points to a valid stack,
65+
* In unwind_next() we'll check that the FP points to a valid stack,
6666
* which can't be STACK_TYPE_UNKNOWN, and the first unwind will be
6767
* treated as a transition to whichever stack that happens to be. The
6868
* prev_fp value won't be used, but we set it to 0 such that it is
@@ -72,7 +72,7 @@ static notrace void start_backtrace(struct stackframe *frame, unsigned long fp,
7272
frame->prev_fp = 0;
7373
frame->prev_type = STACK_TYPE_UNKNOWN;
7474
}
75-
NOKPROBE_SYMBOL(start_backtrace);
75+
NOKPROBE_SYMBOL(unwind_init);
7676

7777
/*
7878
* Unwind from one frame record (A) to the next frame record (B).
@@ -81,8 +81,8 @@ NOKPROBE_SYMBOL(start_backtrace);
8181
* records (e.g. a cycle), determined based on the location and fp value of A
8282
* and the location (but not the fp value) of B.
8383
*/
84-
static int notrace unwind_frame(struct task_struct *tsk,
85-
struct stackframe *frame)
84+
static int notrace unwind_next(struct task_struct *tsk,
85+
struct stackframe *frame)
8686
{
8787
unsigned long fp = frame->fp;
8888
struct stack_info info;
@@ -122,7 +122,7 @@ static int notrace unwind_frame(struct task_struct *tsk,
122122

123123
/*
124124
* Record this frame record's values and location. The prev_fp and
125-
* prev_type are only meaningful to the next unwind_frame() invocation.
125+
* prev_type are only meaningful to the next unwind_next() invocation.
126126
*/
127127
frame->fp = READ_ONCE_NOCHECK(*(unsigned long *)(fp));
128128
frame->pc = READ_ONCE_NOCHECK(*(unsigned long *)(fp + 8));
@@ -155,23 +155,23 @@ static int notrace unwind_frame(struct task_struct *tsk,
155155

156156
return 0;
157157
}
158-
NOKPROBE_SYMBOL(unwind_frame);
158+
NOKPROBE_SYMBOL(unwind_next);
159159

160-
static void notrace walk_stackframe(struct task_struct *tsk,
161-
struct stackframe *frame,
162-
bool (*fn)(void *, unsigned long), void *data)
160+
static void notrace unwind(struct task_struct *tsk,
161+
struct stackframe *frame,
162+
bool (*fn)(void *, unsigned long), void *data)
163163
{
164164
while (1) {
165165
int ret;
166166

167167
if (!fn(data, frame->pc))
168168
break;
169-
ret = unwind_frame(tsk, frame);
169+
ret = unwind_next(tsk, frame);
170170
if (ret < 0)
171171
break;
172172
}
173173
}
174-
NOKPROBE_SYMBOL(walk_stackframe);
174+
NOKPROBE_SYMBOL(unwind);
175175

176176
static bool dump_backtrace_entry(void *arg, unsigned long where)
177177
{
@@ -213,14 +213,14 @@ noinline notrace void arch_stack_walk(stack_trace_consume_fn consume_entry,
213213
struct stackframe frame;
214214

215215
if (regs)
216-
start_backtrace(&frame, regs->regs[29], regs->pc);
216+
unwind_init(&frame, regs->regs[29], regs->pc);
217217
else if (task == current)
218-
start_backtrace(&frame,
218+
unwind_init(&frame,
219219
(unsigned long)__builtin_frame_address(1),
220220
(unsigned long)__builtin_return_address(0));
221221
else
222-
start_backtrace(&frame, thread_saved_fp(task),
222+
unwind_init(&frame, thread_saved_fp(task),
223223
thread_saved_pc(task));
224224

225-
walk_stackframe(task, &frame, consume_entry, cookie);
225+
unwind(task, &frame, consume_entry, cookie);
226226
}

0 commit comments

Comments
 (0)