2 * arch/sh/oprofile/init.c
4 * Copyright (C) 2003 - 2008 Paul Mundt
6 * Based on arch/mips/oprofile/common.c:
8 * Copyright (C) 2004, 2005 Ralf Baechle
9 * Copyright (C) 2005 MIPS Technologies, Inc.
11 * This file is subject to the terms and conditions of the GNU General Public
12 * License. See the file "COPYING" in the main directory of this archive
15 #include <linux/kernel.h>
16 #include <linux/oprofile.h>
17 #include <linux/init.h>
18 #include <linux/errno.h>
19 #include <linux/smp.h>
20 #include <linux/perf_event.h>
21 #include <asm/processor.h>
23 #ifdef CONFIG_HW_PERF_EVENTS
24 extern void sh_backtrace(struct pt_regs * const regs, unsigned int depth);
26 char *op_name_from_perf_id(void)
32 pmu = perf_pmu_name();
36 size = snprintf(buf, sizeof(buf), "sh/%s", pmu);
37 if (size > -1 && size < sizeof(buf))
43 int __init oprofile_arch_init(struct oprofile_operations *ops)
45 ops->backtrace = sh_backtrace;
47 return oprofile_perf_init(ops);
50 void __exit oprofile_arch_exit(void)
55 int __init oprofile_arch_init(struct oprofile_operations *ops)
57 pr_info("oprofile: hardware counters not available\n");
60 void __exit oprofile_arch_exit(void) {}
61 #endif /* CONFIG_HW_PERF_EVENTS */