Blame view

arch/s390/oprofile/init.c 850 Bytes
b24413180   Greg Kroah-Hartman   License cleanup: ...
1
  // SPDX-License-Identifier: GPL-2.0
a53c8fab3   Heiko Carstens   s390/comments: un...
2
  /*
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
3
   * S390 Version
a53c8fab3   Heiko Carstens   s390/comments: un...
4
   *   Copyright IBM Corp. 2002, 2011
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
5
   *   Author(s): Thomas Spatzier (tspat@de.ibm.com)
c814d160f   Heinz Graalfs   oprofile, s390: R...
6
7
   *   Author(s): Mahesh Salgaonkar (mahesh@linux.vnet.ibm.com)
   *   Author(s): Heinz Graalfs (graalfs@linux.vnet.ibm.com)
dd3c4670d   Andreas Krebbel   oprofile, s390: A...
8
   *   Author(s): Andreas Krebbel (krebbel@linux.vnet.ibm.com)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
9
   *
c814d160f   Heinz Graalfs   oprofile, s390: R...
10
   * @remark Copyright 2002-2011 OProfile authors
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
11
12
13
14
   */
  
  #include <linux/oprofile.h>
  #include <linux/init.h>
dd3c4670d   Andreas Krebbel   oprofile, s390: A...
15
  #include <asm/processor.h>
78c98f907   Martin Schwidefsky   s390/unwind: intr...
16
  #include <asm/unwind.h>
758d39ebd   Heiko Carstens   s390/dumpstack: m...
17
18
19
  
  static void s390_backtrace(struct pt_regs *regs, unsigned int depth)
  {
78c98f907   Martin Schwidefsky   s390/unwind: intr...
20
21
22
23
24
25
26
  	struct unwind_state state;
  
  	unwind_for_each_frame(&state, current, regs, 0) {
  		if (depth-- == 0)
  			break;
  		oprofile_add_trace(state.ip);
  	}
758d39ebd   Heiko Carstens   s390/dumpstack: m...
27
  }
ec6b426c4   Robert Richter   oprofile, s390: C...
28
  int __init oprofile_arch_init(struct oprofile_operations *ops)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
29
  {
d0f4c16fe   Andreas Krebbel   [PATCH] s390: add...
30
  	ops->backtrace = s390_backtrace;
dd3c4670d   Andreas Krebbel   oprofile, s390: A...
31
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
32
33
34
35
36
  }
  
  void oprofile_arch_exit(void)
  {
  }