~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/sh/oprofile/common.c

Version: ~ [ linux-5.13-rc7 ] ~ [ linux-5.12.12 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.45 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.127 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.195 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.237 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.273 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.273 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.18.140 ] ~ [ linux-3.16.85 ] ~ [ linux-3.14.79 ] ~ [ linux-3.12.74 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * arch/sh/oprofile/init.c
  3  *
  4  * Copyright (C) 2003 - 2010  Paul Mundt
  5  *
  6  * Based on arch/mips/oprofile/common.c:
  7  *
  8  *      Copyright (C) 2004, 2005 Ralf Baechle
  9  *      Copyright (C) 2005 MIPS Technologies, Inc.
 10  *
 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
 13  * for more details.
 14  */
 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 <linux/slab.h>
 22 #include <asm/processor.h>
 23 
 24 extern void sh_backtrace(struct pt_regs * const regs, unsigned int depth);
 25 
 26 #ifdef CONFIG_HW_PERF_EVENTS
 27 /*
 28  * This will need to be reworked when multiple PMUs are supported.
 29  */
 30 static char *sh_pmu_op_name;
 31 
 32 char *op_name_from_perf_id(void)
 33 {
 34         return sh_pmu_op_name;
 35 }
 36 
 37 int __init oprofile_arch_init(struct oprofile_operations *ops)
 38 {
 39         ops->backtrace = sh_backtrace;
 40 
 41         if (perf_num_counters() == 0)
 42                 return -ENODEV;
 43 
 44         sh_pmu_op_name = kasprintf(GFP_KERNEL, "%s/%s",
 45                                    UTS_MACHINE, perf_pmu_name());
 46         if (unlikely(!sh_pmu_op_name))
 47                 return -ENOMEM;
 48 
 49         return oprofile_perf_init(ops);
 50 }
 51 
 52 void oprofile_arch_exit(void)
 53 {
 54         oprofile_perf_exit();
 55         kfree(sh_pmu_op_name);
 56 }
 57 #else
 58 int __init oprofile_arch_init(struct oprofile_operations *ops)
 59 {
 60         ops->backtrace = sh_backtrace;
 61         return -ENODEV;
 62 }
 63 void oprofile_arch_exit(void) {}
 64 #endif /* CONFIG_HW_PERF_EVENTS */
 65 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp