From: Li Huafei lihuafei1@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I5CJ7X
--------------------------------
Fix the spelling error of 'CONFIG_ FUNCTION_GRAPH_TRACE' and two compilation errors: - 'ftrace_idx' is not defined - 'struct stackframe' does not have a member named 'ip'
Fixes: ac81d625f3da ("livepatch/ppc64: Implement livepatch without ftrace for ppc64be") Signed-off-by: Li Huafei lihuafei1@huawei.com Reviewed-by: Xu Kuohai xukuohai@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- arch/powerpc/kernel/livepatch_64.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/kernel/livepatch_64.c b/arch/powerpc/kernel/livepatch_64.c index f008b3beb001..2487fab569a7 100644 --- a/arch/powerpc/kernel/livepatch_64.c +++ b/arch/powerpc/kernel/livepatch_64.c @@ -250,6 +250,9 @@ static int unwind_frame(struct task_struct *tsk, struct stackframe *frame) {
unsigned long *stack; +#ifdef CONFIG_FUNCTION_GRAPH_TRACER + int ftrace_idx = 0; +#endif
if (!validate_sp(frame->sp, tsk, STACK_FRAME_OVERHEAD)) return -1; @@ -279,12 +282,12 @@ static int unwind_frame(struct task_struct *tsk, struct stackframe *frame)
frame->sp = stack[0]; frame->pc = stack[STACK_FRAME_LR_SAVE]; -#ifdef CONFIG_FUNCTION_GRAPH_TRACE +#ifdef CONFIG_FUNCTION_GRAPH_TRACER /* * IMHO these tests do not belong in * arch-dependent code, they are generic. */ - frame->pc = ftrace_graph_ret_addr(tsk, &ftrace_idx, frame->ip, stack); + frame->pc = ftrace_graph_ret_addr(tsk, &ftrace_idx, frame->pc, stack); #endif
return 0;