diff options
Diffstat (limited to 'arch/sparc/kernel/perf_event.c')
-rw-r--r-- | arch/sparc/kernel/perf_event.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index e2771939341d..34ce49f80eac 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | #include <linux/perf_event.h> | 15 | #include <linux/perf_event.h> |
16 | #include <linux/kprobes.h> | 16 | #include <linux/kprobes.h> |
17 | #include <linux/ftrace.h> | ||
17 | #include <linux/kernel.h> | 18 | #include <linux/kernel.h> |
18 | #include <linux/kdebug.h> | 19 | #include <linux/kdebug.h> |
19 | #include <linux/mutex.h> | 20 | #include <linux/mutex.h> |
@@ -1276,6 +1277,9 @@ static void perf_callchain_kernel(struct pt_regs *regs, | |||
1276 | struct perf_callchain_entry *entry) | 1277 | struct perf_callchain_entry *entry) |
1277 | { | 1278 | { |
1278 | unsigned long ksp, fp; | 1279 | unsigned long ksp, fp; |
1280 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
1281 | int graph = 0; | ||
1282 | #endif | ||
1279 | 1283 | ||
1280 | callchain_store(entry, PERF_CONTEXT_KERNEL); | 1284 | callchain_store(entry, PERF_CONTEXT_KERNEL); |
1281 | callchain_store(entry, regs->tpc); | 1285 | callchain_store(entry, regs->tpc); |
@@ -1303,6 +1307,16 @@ static void perf_callchain_kernel(struct pt_regs *regs, | |||
1303 | fp = (unsigned long)sf->fp + STACK_BIAS; | 1307 | fp = (unsigned long)sf->fp + STACK_BIAS; |
1304 | } | 1308 | } |
1305 | callchain_store(entry, pc); | 1309 | callchain_store(entry, pc); |
1310 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
1311 | if ((pc + 8UL) == (unsigned long) &return_to_handler) { | ||
1312 | int index = current->curr_ret_stack; | ||
1313 | if (current->ret_stack && index >= graph) { | ||
1314 | pc = current->ret_stack[index - graph].ret; | ||
1315 | callchain_store(entry, pc); | ||
1316 | graph++; | ||
1317 | } | ||
1318 | } | ||
1319 | #endif | ||
1306 | } while (entry->nr < PERF_MAX_STACK_DEPTH); | 1320 | } while (entry->nr < PERF_MAX_STACK_DEPTH); |
1307 | } | 1321 | } |
1308 | 1322 | ||