2017-11-24 17:00:32 +03:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2006-07-03 11:24:41 +04:00
|
|
|
/*
|
|
|
|
* Stack trace management functions
|
|
|
|
*
|
2012-07-20 13:15:04 +04:00
|
|
|
* Copyright IBM Corp. 2006
|
2006-07-03 11:24:41 +04:00
|
|
|
* Author(s): Heiko Carstens <heiko.carstens@de.ibm.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/stacktrace.h>
|
2019-01-28 10:33:08 +03:00
|
|
|
#include <asm/stacktrace.h>
|
|
|
|
#include <asm/unwind.h>
|
2016-02-01 16:14:04 +03:00
|
|
|
|
2019-08-14 15:27:44 +03:00
|
|
|
void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie,
|
|
|
|
struct task_struct *task, struct pt_regs *regs)
|
2016-02-01 16:14:04 +03:00
|
|
|
{
|
2019-01-28 10:33:08 +03:00
|
|
|
struct unwind_state state;
|
2019-08-14 15:27:44 +03:00
|
|
|
unsigned long addr;
|
2016-02-01 16:14:04 +03:00
|
|
|
|
2019-08-14 15:27:44 +03:00
|
|
|
unwind_for_each_frame(&state, task, regs, 0) {
|
|
|
|
addr = unwind_get_return_address(&state);
|
|
|
|
if (!addr || !consume_entry(cookie, addr, false))
|
2019-01-28 10:33:08 +03:00
|
|
|
break;
|
|
|
|
}
|
2008-02-05 18:50:45 +03:00
|
|
|
}
|