Release 4.7 drivers/oprofile/timer_int.c
/**
* @file timer_int.c
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
*
* @author John Levon <levon@movementarian.org>
*/
#include <linux/kernel.h>
#include <linux/notifier.h>
#include <linux/smp.h>
#include <linux/oprofile.h>
#include <linux/profile.h>
#include <linux/init.h>
#include <linux/cpu.h>
#include <linux/hrtimer.h>
#include <asm/irq_regs.h>
#include <asm/ptrace.h>
#include "oprof.h"
static DEFINE_PER_CPU(struct hrtimer, oprofile_hrtimer);
static int ctr_running;
static enum hrtimer_restart oprofile_hrtimer_notify(struct hrtimer *hrtimer)
{
oprofile_add_sample(get_irq_regs(), 0);
hrtimer_forward_now(hrtimer, ns_to_ktime(TICK_NSEC));
return HRTIMER_RESTART;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 18 | 54.55% | 1 | 33.33% |
john levon | john levon | 13 | 39.39% | 1 | 33.33% |
jesse barnes | jesse barnes | 2 | 6.06% | 1 | 33.33% |
| Total | 33 | 100.00% | 3 | 100.00% |
static void __oprofile_hrtimer_start(void *unused)
{
struct hrtimer *hrtimer = this_cpu_ptr(&oprofile_hrtimer);
if (!ctr_running)
return;
hrtimer_init(hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
hrtimer->function = oprofile_hrtimer_notify;
hrtimer_start(hrtimer, ns_to_ktime(TICK_NSEC),
HRTIMER_MODE_REL_PINNED);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 46 | 85.19% | 1 | 33.33% |
santosh shilimkar | santosh shilimkar | 6 | 11.11% | 1 | 33.33% |
christoph lameter | christoph lameter | 2 | 3.70% | 1 | 33.33% |
| Total | 54 | 100.00% | 3 | 100.00% |
static int oprofile_hrtimer_start(void)
{
get_online_cpus();
ctr_running = 1;
on_each_cpu(__oprofile_hrtimer_start, NULL, 1);
put_online_cpus();
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
john levon | john levon | 10 | 33.33% | 1 | 33.33% |
santosh shilimkar | santosh shilimkar | 10 | 33.33% | 1 | 33.33% |
martin schwidefsky | martin schwidefsky | 10 | 33.33% | 1 | 33.33% |
| Total | 30 | 100.00% | 3 | 100.00% |
static void __oprofile_hrtimer_stop(int cpu)
{
struct hrtimer *hrtimer = &per_cpu(oprofile_hrtimer, cpu);
if (!ctr_running)
return;
hrtimer_cancel(hrtimer);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 27 | 81.82% | 1 | 50.00% |
santosh shilimkar | santosh shilimkar | 6 | 18.18% | 1 | 50.00% |
| Total | 33 | 100.00% | 2 | 100.00% |
static void oprofile_hrtimer_stop(void)
{
int cpu;
get_online_cpus();
for_each_online_cpu(cpu)
__oprofile_hrtimer_stop(cpu);
ctr_running = 0;
put_online_cpus();
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 10 | 33.33% | 1 | 33.33% |
john levon | john levon | 10 | 33.33% | 1 | 33.33% |
santosh shilimkar | santosh shilimkar | 10 | 33.33% | 1 | 33.33% |
| Total | 30 | 100.00% | 3 | 100.00% |
static int oprofile_cpu_notify(struct notifier_block *self,
unsigned long action, void *hcpu)
{
long cpu = (long) hcpu;
switch (action) {
case CPU_ONLINE:
case CPU_ONLINE_FROZEN:
smp_call_function_single(cpu, __oprofile_hrtimer_start,
NULL, 1);
break;
case CPU_DEAD:
case CPU_DEAD_FROZEN:
__oprofile_hrtimer_stop(cpu);
break;
}
return NOTIFY_OK;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 65 | 98.48% | 1 | 50.00% |
john levon | john levon | 1 | 1.52% | 1 | 50.00% |
| Total | 66 | 100.00% | 2 | 100.00% |
static struct notifier_block __refdata oprofile_cpu_notifier = {
.notifier_call = oprofile_cpu_notify,
};
static int oprofile_hrtimer_setup(void)
{
return register_hotcpu_notifier(&oprofile_cpu_notifier);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 7 | 46.67% | 1 | 33.33% |
robert richter | robert richter | 5 | 33.33% | 1 | 33.33% |
john levon | john levon | 3 | 20.00% | 1 | 33.33% |
| Total | 15 | 100.00% | 3 | 100.00% |
static void oprofile_hrtimer_shutdown(void)
{
unregister_hotcpu_notifier(&oprofile_cpu_notifier);
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
robert richter | robert richter | 14 | 100.00% | 1 | 100.00% |
| Total | 14 | 100.00% | 1 | 100.00% |
int oprofile_timer_init(struct oprofile_operations *ops)
{
ops->create_files = NULL;
ops->setup = oprofile_hrtimer_setup;
ops->shutdown = oprofile_hrtimer_shutdown;
ops->start = oprofile_hrtimer_start;
ops->stop = oprofile_hrtimer_stop;
ops->cpu_type = "timer";
printk(KERN_INFO "oprofile: using timer interrupt.\n");
return 0;
}
Contributors
| Person | Tokens | Prop | Commits | CommitProp |
robert richter | robert richter | 23 | 41.82% | 3 | 42.86% |
greg banks | greg banks | 22 | 40.00% | 2 | 28.57% |
martin schwidefsky | martin schwidefsky | 6 | 10.91% | 1 | 14.29% |
john levon | john levon | 4 | 7.27% | 1 | 14.29% |
| Total | 55 | 100.00% | 7 | 100.00% |
Overall Contributors
| Person | Tokens | Prop | Commits | CommitProp |
martin schwidefsky | martin schwidefsky | 220 | 56.41% | 1 | 9.09% |
john levon | john levon | 57 | 14.62% | 1 | 9.09% |
robert richter | robert richter | 42 | 10.77% | 3 | 27.27% |
santosh shilimkar | santosh shilimkar | 36 | 9.23% | 1 | 9.09% |
greg banks | greg banks | 25 | 6.41% | 2 | 18.18% |
david s. miller | david s. miller | 6 | 1.54% | 1 | 9.09% |
christoph lameter | christoph lameter | 2 | 0.51% | 1 | 9.09% |
jesse barnes | jesse barnes | 2 | 0.51% | 1 | 9.09% |
| Total | 390 | 100.00% | 11 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.