Release 4.11 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 | 18 | 54.55% | 1 | 33.33% |
John Levon | 13 | 39.39% | 1 | 33.33% |
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 | 46 | 85.19% | 1 | 33.33% |
Santosh Shilimkar | 6 | 11.11% | 1 | 33.33% |
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 | 10 | 33.33% | 1 | 33.33% |
Santosh Shilimkar | 10 | 33.33% | 1 | 33.33% |
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 | 27 | 81.82% | 1 | 50.00% |
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 |
Santosh Shilimkar | 10 | 33.33% | 1 | 33.33% |
John Levon | 10 | 33.33% | 1 | 33.33% |
Martin Schwidefsky | 10 | 33.33% | 1 | 33.33% |
Total | 30 | 100.00% | 3 | 100.00% |
static int oprofile_timer_online(unsigned int cpu)
{
local_irq_disable();
__oprofile_hrtimer_start(NULL);
local_irq_enable();
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sebastian Andrzej Siewior | 14 | 58.33% | 1 | 50.00% |
Martin Schwidefsky | 10 | 41.67% | 1 | 50.00% |
Total | 24 | 100.00% | 2 | 100.00% |
static int oprofile_timer_prep_down(unsigned int cpu)
{
__oprofile_hrtimer_stop(cpu);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sebastian Andrzej Siewior | 10 | 55.56% | 1 | 50.00% |
Martin Schwidefsky | 8 | 44.44% | 1 | 50.00% |
Total | 18 | 100.00% | 2 | 100.00% |
static enum cpuhp_state hp_online;
static int oprofile_hrtimer_setup(void)
{
int ret;
ret = cpuhp_setup_state_nocalls(CPUHP_AP_ONLINE_DYN,
"oprofile/timer:online",
oprofile_timer_online,
oprofile_timer_prep_down);
if (ret < 0)
return ret;
hp_online = ret;
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Sebastian Andrzej Siewior | 29 | 72.50% | 1 | 25.00% |
Robert Richter | 4 | 10.00% | 1 | 25.00% |
Martin Schwidefsky | 4 | 10.00% | 1 | 25.00% |
John Levon | 3 | 7.50% | 1 | 25.00% |
Total | 40 | 100.00% | 4 | 100.00% |
static void oprofile_hrtimer_shutdown(void)
{
cpuhp_remove_state_nocalls(hp_online);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Robert Richter | 11 | 84.62% | 1 | 50.00% |
Sebastian Andrzej Siewior | 2 | 15.38% | 1 | 50.00% |
Total | 13 | 100.00% | 2 | 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 | 23 | 41.82% | 3 | 42.86% |
Greg Banks | 22 | 40.00% | 2 | 28.57% |
Martin Schwidefsky | 6 | 10.91% | 1 | 14.29% |
John Levon | 4 | 7.27% | 1 | 14.29% |
Total | 55 | 100.00% | 7 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Martin Schwidefsky | 159 | 41.62% | 1 | 8.33% |
Sebastian Andrzej Siewior | 58 | 15.18% | 1 | 8.33% |
John Levon | 56 | 14.66% | 1 | 8.33% |
Robert Richter | 38 | 9.95% | 3 | 25.00% |
Santosh Shilimkar | 36 | 9.42% | 1 | 8.33% |
Greg Banks | 25 | 6.54% | 2 | 16.67% |
David S. Miller | 6 | 1.57% | 1 | 8.33% |
Christoph Lameter | 2 | 0.52% | 1 | 8.33% |
Jesse Barnes | 2 | 0.52% | 1 | 8.33% |
Total | 382 | 100.00% | 12 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.