mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
riscv: Make stack walk callback consistent with generic code
In order to use generic arch_stack_walk() code, make stack walk callback consistent with it. Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
This commit is contained in:
parent
99c168fccb
commit
9dd97064e2
3 changed files with 7 additions and 7 deletions
|
@ -12,6 +12,6 @@ struct stackframe {
|
||||||
};
|
};
|
||||||
|
|
||||||
extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
|
extern void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
|
||||||
bool (*fn)(unsigned long, void *), void *arg);
|
bool (*fn)(void *, unsigned long), void *arg);
|
||||||
|
|
||||||
#endif /* _ASM_RISCV_STACKTRACE_H */
|
#endif /* _ASM_RISCV_STACKTRACE_H */
|
||||||
|
|
|
@ -70,7 +70,7 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
|
||||||
fp = user_backtrace(entry, fp, 0);
|
fp = user_backtrace(entry, fp, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool fill_callchain(unsigned long pc, void *entry)
|
static bool fill_callchain(void *entry, unsigned long pc)
|
||||||
{
|
{
|
||||||
return perf_callchain_store(entry, pc);
|
return perf_callchain_store(entry, pc);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,7 +43,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
|
||||||
unsigned long low, high;
|
unsigned long low, high;
|
||||||
struct stackframe *frame;
|
struct stackframe *frame;
|
||||||
|
|
||||||
if (unlikely(!__kernel_text_address(pc) || fn(pc, arg)))
|
if (unlikely(!__kernel_text_address(pc) || fn(arg, pc)))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* Validate frame pointer */
|
/* Validate frame pointer */
|
||||||
|
@ -63,7 +63,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
|
||||||
#else /* !CONFIG_FRAME_POINTER */
|
#else /* !CONFIG_FRAME_POINTER */
|
||||||
|
|
||||||
void notrace walk_stackframe(struct task_struct *task,
|
void notrace walk_stackframe(struct task_struct *task,
|
||||||
struct pt_regs *regs, bool (*fn)(unsigned long, void *), void *arg)
|
struct pt_regs *regs, bool (*fn)(void *, unsigned long), void *arg)
|
||||||
{
|
{
|
||||||
unsigned long sp, pc;
|
unsigned long sp, pc;
|
||||||
unsigned long *ksp;
|
unsigned long *ksp;
|
||||||
|
@ -85,7 +85,7 @@ void notrace walk_stackframe(struct task_struct *task,
|
||||||
|
|
||||||
ksp = (unsigned long *)sp;
|
ksp = (unsigned long *)sp;
|
||||||
while (!kstack_end(ksp)) {
|
while (!kstack_end(ksp)) {
|
||||||
if (__kernel_text_address(pc) && unlikely(fn(pc, arg)))
|
if (__kernel_text_address(pc) && unlikely(fn(arg, pc)))
|
||||||
break;
|
break;
|
||||||
pc = (*ksp++) - 0x4;
|
pc = (*ksp++) - 0x4;
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ void show_stack(struct task_struct *task, unsigned long *sp, const char *loglvl)
|
||||||
walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
|
walk_stackframe(task, NULL, print_trace_address, (void *)loglvl);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool save_wchan(unsigned long pc, void *arg)
|
static bool save_wchan(void *arg, unsigned long pc)
|
||||||
{
|
{
|
||||||
if (!in_sched_functions(pc)) {
|
if (!in_sched_functions(pc)) {
|
||||||
unsigned long *p = arg;
|
unsigned long *p = arg;
|
||||||
|
@ -143,7 +143,7 @@ static bool __save_trace(unsigned long pc, void *arg, bool nosched)
|
||||||
return (trace->nr_entries >= trace->max_entries);
|
return (trace->nr_entries >= trace->max_entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool save_trace(unsigned long pc, void *arg)
|
static bool save_trace(void *arg, unsigned long pc)
|
||||||
{
|
{
|
||||||
return __save_trace(pc, arg, false);
|
return __save_trace(pc, arg, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue