cregit-Linux how code gets into the kernel

Release 4.14 arch/sh/oprofile/common.c

Directory: arch/sh/oprofile
/*
 * arch/sh/oprofile/init.c
 *
 * Copyright (C) 2003 - 2010  Paul Mundt
 *
 * Based on arch/mips/oprofile/common.c:
 *
 *      Copyright (C) 2004, 2005 Ralf Baechle
 *      Copyright (C) 2005 MIPS Technologies, Inc.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 */
#include <linux/kernel.h>
#include <linux/oprofile.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/smp.h>
#include <linux/perf_event.h>
#include <linux/slab.h>
#include <asm/processor.h>

extern void sh_backtrace(struct pt_regs * const regs, unsigned int depth);

#ifdef CONFIG_HW_PERF_EVENTS
/*
 * This will need to be reworked when multiple PMUs are supported.
 */

static char *sh_pmu_op_name;


char *op_name_from_perf_id(void) { return sh_pmu_op_name; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt872.73%266.67%
Matt Fleming327.27%133.33%
Total11100.00%3100.00%


int __init oprofile_arch_init(struct oprofile_operations *ops) { ops->backtrace = sh_backtrace; if (perf_num_counters() == 0) return -ENODEV; sh_pmu_op_name = kasprintf(GFP_KERNEL, "%s/%s", UTS_MACHINE, perf_pmu_name()); if (unlikely(!sh_pmu_op_name)) return -ENOMEM; return oprofile_perf_init(ops); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt4676.67%266.67%
Matt Fleming1423.33%133.33%
Total60100.00%3100.00%


void oprofile_arch_exit(void) { oprofile_perf_exit(); kfree(sh_pmu_op_name); }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt1280.00%266.67%
Matt Fleming320.00%133.33%
Total15100.00%3100.00%

#else
int __init oprofile_arch_init(struct oprofile_operations *ops) { ops->backtrace = sh_backtrace; return -ENODEV; }

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt1990.48%266.67%
Matt Fleming29.52%133.33%
Total21100.00%3100.00%


void oprofile_arch_exit(void) {}

Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt583.33%150.00%
Matt Fleming116.67%150.00%
Total6100.00%2100.00%

#endif /* CONFIG_HW_PERF_EVENTS */

Overall Contributors

PersonTokensPropCommitsCommitProp
Paul Mundt12273.05%360.00%
Matt Fleming3017.96%120.00%
Dave Peverley158.98%120.00%
Total167100.00%5100.00%
Directory: arch/sh/oprofile
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.