|
5 | 5 | * Copyright (C) 2015 ARM Limited
|
6 | 6 | */
|
7 | 7 | #include <linux/perf_event.h>
|
| 8 | +#include <linux/stacktrace.h> |
8 | 9 | #include <linux/uaccess.h>
|
9 | 10 |
|
10 | 11 | #include <asm/pointer_auth.h>
|
11 |
| -#include <asm/stacktrace.h> |
12 | 12 |
|
13 | 13 | struct frame_tail {
|
14 | 14 | struct frame_tail __user *fp;
|
@@ -132,30 +132,21 @@ void perf_callchain_user(struct perf_callchain_entry_ctx *entry,
|
132 | 132 | }
|
133 | 133 | }
|
134 | 134 |
|
135 |
| -/* |
136 |
| - * Gets called by walk_stackframe() for every stackframe. This will be called |
137 |
| - * whist unwinding the stackframe and is like a subroutine return so we use |
138 |
| - * the PC. |
139 |
| - */ |
140 | 135 | static bool callchain_trace(void *data, unsigned long pc)
|
141 | 136 | {
|
142 | 137 | struct perf_callchain_entry_ctx *entry = data;
|
143 |
| - perf_callchain_store(entry, pc); |
144 |
| - return true; |
| 138 | + return perf_callchain_store(entry, pc) == 0; |
145 | 139 | }
|
146 | 140 |
|
147 | 141 | void perf_callchain_kernel(struct perf_callchain_entry_ctx *entry,
|
148 | 142 | struct pt_regs *regs)
|
149 | 143 | {
|
150 |
| - struct stackframe frame; |
151 |
| - |
152 | 144 | if (perf_guest_cbs && perf_guest_cbs->is_in_guest()) {
|
153 | 145 | /* We don't support guest os callchain now */
|
154 | 146 | return;
|
155 | 147 | }
|
156 | 148 |
|
157 |
| - start_backtrace(&frame, regs->regs[29], regs->pc); |
158 |
| - walk_stackframe(current, &frame, callchain_trace, entry); |
| 149 | + arch_stack_walk(callchain_trace, entry, current, regs); |
159 | 150 | }
|
160 | 151 |
|
161 | 152 | unsigned long perf_instruction_pointer(struct pt_regs *regs)
|
|
0 commit comments