Commit | Line | Data |
---|---|---|
b2441318 | 1 | // SPDX-License-Identifier: GPL-2.0 |
a53c8fab | 2 | /* |
1da177e4 | 3 | * S390 Version |
a53c8fab | 4 | * Copyright IBM Corp. 2002, 2011 |
1da177e4 | 5 | * Author(s): Thomas Spatzier (tspat@de.ibm.com) |
c814d160 HG |
6 | * Author(s): Mahesh Salgaonkar (mahesh@linux.vnet.ibm.com) |
7 | * Author(s): Heinz Graalfs (graalfs@linux.vnet.ibm.com) | |
dd3c4670 | 8 | * Author(s): Andreas Krebbel (krebbel@linux.vnet.ibm.com) |
1da177e4 | 9 | * |
c814d160 | 10 | * @remark Copyright 2002-2011 OProfile authors |
1da177e4 LT |
11 | */ |
12 | ||
13 | #include <linux/oprofile.h> | |
14 | #include <linux/init.h> | |
dd3c4670 | 15 | #include <asm/processor.h> |
78c98f90 | 16 | #include <asm/unwind.h> |
758d39eb HC |
17 | |
18 | static void s390_backtrace(struct pt_regs *regs, unsigned int depth) | |
19 | { | |
78c98f90 MS |
20 | struct unwind_state state; |
21 | ||
22 | unwind_for_each_frame(&state, current, regs, 0) { | |
23 | if (depth-- == 0) | |
24 | break; | |
25 | oprofile_add_trace(state.ip); | |
26 | } | |
758d39eb HC |
27 | } |
28 | ||
ec6b426c | 29 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
1da177e4 | 30 | { |
d0f4c16f | 31 | ops->backtrace = s390_backtrace; |
dd3c4670 | 32 | return 0; |
1da177e4 LT |
33 | } |
34 | ||
35 | void oprofile_arch_exit(void) | |
36 | { | |
37 | } |