cregit-Linux how code gets into the kernel

Release 4.14 arch/sparc/oprofile/init.c

/**
 * @file init.c
 *
 * @remark Copyright 2002 OProfile authors
 * @remark Read the file COPYING
 *
 * @author John Levon <levon@movementarian.org>
 */

#include <linux/kernel.h>
#include <linux/oprofile.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/param.h>	/* for HZ */
 
#ifdef CONFIG_SPARC64
#include <linux/notifier.h>
#include <linux/rcupdate.h>
#include <linux/kdebug.h>
#include <asm/nmi.h>


static int profile_timer_exceptions_notify(struct notifier_block *self, unsigned long val, void *data) { struct die_args *args = data; int ret = NOTIFY_DONE; switch (val) { case DIE_NMI: oprofile_add_sample(args->regs, 0); ret = NOTIFY_STOP; break; default: break; } return ret; }

Contributors

PersonTokensPropCommitsCommitProp
David S. Miller59100.00%3100.00%
Total59100.00%3100.00%

static struct notifier_block profile_timer_exceptions_nb = { .notifier_call = profile_timer_exceptions_notify, };
static int timer_start(void) { if (register_die_notifier(&profile_timer_exceptions_nb)) return 1; nmi_adjust_hz(HZ); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
David S. Miller27100.00%2100.00%
Total27100.00%2100.00%


static void timer_stop(void) { nmi_adjust_hz(1); unregister_die_notifier(&profile_timer_exceptions_nb); synchronize_sched(); /* Allow already-started NMIs to complete. */ }

Contributors

PersonTokensPropCommitsCommitProp
David S. Miller23100.00%2100.00%
Total23100.00%2100.00%


static int op_nmi_timer_init(struct oprofile_operations *ops) { if (atomic_read(&nmi_active) <= 0) return -ENODEV; ops->start = timer_start; ops->stop = timer_stop; ops->cpu_type = "timer"; printk(KERN_INFO "oprofile: Using perfctr NMI timer interrupt.\n"); return 0; }

Contributors

PersonTokensPropCommitsCommitProp
David S. Miller52100.00%4100.00%
Total52100.00%4100.00%

#endif
int __init oprofile_arch_init(struct oprofile_operations *ops) { int ret = -ENODEV; #ifdef CONFIG_SPARC64 ret = op_nmi_timer_init(ops); if (!ret) return ret; #endif return ret; }

Contributors

PersonTokensPropCommitsCommitProp
David S. Miller2665.00%266.67%
Martin Habets1435.00%133.33%
Total40100.00%3100.00%


void oprofile_arch_exit(void) { }

Contributors

PersonTokensPropCommitsCommitProp
Martin Habets583.33%150.00%
David S. Miller116.67%150.00%
Total6100.00%2100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
David S. Miller21785.77%571.43%
Martin Habets3212.65%114.29%
Stephen Rothwell41.58%114.29%
Total253100.00%7100.00%
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.