Linux 4.13.16
[linux/fpc-iii.git] / arch / s390 / oprofile / init.c
blob9a4de4599c7b99a82f4a38989a309c896f4e73f3
1 /*
2 * S390 Version
3 * Copyright IBM Corp. 2002, 2011
4 * Author(s): Thomas Spatzier (tspat@de.ibm.com)
5 * Author(s): Mahesh Salgaonkar (mahesh@linux.vnet.ibm.com)
6 * Author(s): Heinz Graalfs (graalfs@linux.vnet.ibm.com)
7 * Author(s): Andreas Krebbel (krebbel@linux.vnet.ibm.com)
9 * @remark Copyright 2002-2011 OProfile authors
12 #include <linux/oprofile.h>
13 #include <linux/init.h>
14 #include <asm/processor.h>
16 static int __s390_backtrace(void *data, unsigned long address, int reliable)
18 unsigned int *depth = data;
20 if (*depth == 0)
21 return 1;
22 (*depth)--;
23 oprofile_add_trace(address);
24 return 0;
27 static void s390_backtrace(struct pt_regs *regs, unsigned int depth)
29 if (user_mode(regs))
30 return;
31 dump_trace(__s390_backtrace, &depth, NULL, regs->gprs[15]);
34 int __init oprofile_arch_init(struct oprofile_operations *ops)
36 ops->backtrace = s390_backtrace;
37 return 0;
40 void oprofile_arch_exit(void)