2012-07-20 17:15:04 +08:00
|
|
|
/*
|
2005-04-17 06:20:36 +08:00
|
|
|
* S390 Version
|
2012-07-20 17:15:04 +08:00
|
|
|
* Copyright IBM Corp. 2002, 2011
|
2005-04-17 06:20:36 +08:00
|
|
|
* Author(s): Thomas Spatzier (tspat@de.ibm.com)
|
2011-02-16 02:02:14 +08:00
|
|
|
* Author(s): Mahesh Salgaonkar (mahesh@linux.vnet.ibm.com)
|
|
|
|
* Author(s): Heinz Graalfs (graalfs@linux.vnet.ibm.com)
|
2011-11-26 03:03:05 +08:00
|
|
|
* Author(s): Andreas Krebbel (krebbel@linux.vnet.ibm.com)
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
2011-02-16 02:02:14 +08:00
|
|
|
* @remark Copyright 2002-2011 OProfile authors
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include <linux/oprofile.h>
|
|
|
|
#include <linux/init.h>
|
2011-11-26 03:03:05 +08:00
|
|
|
#include <asm/processor.h>
|
2011-02-16 02:02:14 +08:00
|
|
|
|
2016-10-17 17:08:31 +08:00
|
|
|
static int __s390_backtrace(void *data, unsigned long address, int reliable)
|
2016-02-09 19:58:54 +08:00
|
|
|
{
|
|
|
|
unsigned int *depth = data;
|
|
|
|
|
|
|
|
if (*depth == 0)
|
|
|
|
return 1;
|
|
|
|
(*depth)--;
|
|
|
|
oprofile_add_trace(address);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void s390_backtrace(struct pt_regs *regs, unsigned int depth)
|
|
|
|
{
|
|
|
|
if (user_mode(regs))
|
|
|
|
return;
|
|
|
|
dump_trace(__s390_backtrace, &depth, NULL, regs->gprs[15]);
|
|
|
|
}
|
|
|
|
|
2011-03-16 19:10:12 +08:00
|
|
|
int __init oprofile_arch_init(struct oprofile_operations *ops)
|
2005-04-17 06:20:36 +08:00
|
|
|
{
|
2006-01-06 16:19:16 +08:00
|
|
|
ops->backtrace = s390_backtrace;
|
2011-11-26 03:03:05 +08:00
|
|
|
return 0;
|
2005-04-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void oprofile_arch_exit(void)
|
|
|
|
{
|
|
|
|
}
|