Skip to content

Commit 393da6c

Browse files
puranjaymohanpalmer-dabbelt
authored andcommitted
riscv: stacktrace: fix usage of ftrace_graph_ret_addr()
ftrace_graph_ret_addr() takes an `idx` integer pointer that is used to optimize the stack unwinding. Pass it a valid pointer to utilize the optimizations that might be available in the future. The commit is making riscv's usage of ftrace_graph_ret_addr() match x86_64. Signed-off-by: Puranjay Mohan <[email protected]> Reviewed-by: Steven Rostedt (Google) <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent 3582ce0 commit 393da6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

arch/riscv/kernel/stacktrace.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
3232
bool (*fn)(void *, unsigned long), void *arg)
3333
{
3434
unsigned long fp, sp, pc;
35+
int graph_idx = 0;
3536
int level = 0;
3637

3738
if (regs) {
@@ -68,7 +69,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
6869
pc = regs->ra;
6970
} else {
7071
fp = frame->fp;
71-
pc = ftrace_graph_ret_addr(current, NULL, frame->ra,
72+
pc = ftrace_graph_ret_addr(current, &graph_idx, frame->ra,
7273
&frame->ra);
7374
if (pc == (unsigned long)ret_from_exception) {
7475
if (unlikely(!__kernel_text_address(pc) || !fn(arg, pc)))

0 commit comments

Comments
 (0)