Merge branch 'regulator-5.1' into regulator-next
[linux-2.6-block.git] / arch / s390 / oprofile / init.c
CommitLineData
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>
c814d160 16
d0208639 17static int __s390_backtrace(void *data, unsigned long address, int reliable)
758d39eb
HC
18{
19 unsigned int *depth = data;
20
21 if (*depth == 0)
22 return 1;
23 (*depth)--;
24 oprofile_add_trace(address);
25 return 0;
26}
27
28static void s390_backtrace(struct pt_regs *regs, unsigned int depth)
29{
30 if (user_mode(regs))
31 return;
32 dump_trace(__s390_backtrace, &depth, NULL, regs->gprs[15]);
33}
34
ec6b426c 35int __init oprofile_arch_init(struct oprofile_operations *ops)
1da177e4 36{
d0f4c16f 37 ops->backtrace = s390_backtrace;
dd3c4670 38 return 0;
1da177e4
LT
39}
40
41void oprofile_arch_exit(void)
42{
43}