Release 4.14 arch/alpha/oprofile/common.c
/**
* @file arch/alpha/oprofile/common.c
*
* @remark Copyright 2002 OProfile authors
* @remark Read the file COPYING
*
* @author Richard Henderson <rth@twiddle.net>
*/
#include <linux/oprofile.h>
#include <linux/init.h>
#include <linux/smp.h>
#include <linux/errno.h>
#include <asm/ptrace.h>
#include <asm/special_insns.h>
#include "op_impl.h"
extern struct op_axp_model op_model_ev4 __attribute__((weak));
extern struct op_axp_model op_model_ev5 __attribute__((weak));
extern struct op_axp_model op_model_pca56 __attribute__((weak));
extern struct op_axp_model op_model_ev6 __attribute__((weak));
extern struct op_axp_model op_model_ev67 __attribute__((weak));
static struct op_axp_model *model;
extern void (*perf_irq)(unsigned long, struct pt_regs *);
static void (*save_perf_irq)(unsigned long, struct pt_regs *);
static struct op_counter_config ctr[20];
static struct op_system_config sys;
static struct op_register_config reg;
/* Called from do_entInt to handle the performance monitor interrupt. */
static void
op_handle_interrupt(unsigned long which, struct pt_regs *regs)
{
model->handle_interrupt(which, regs, ctr);
/* If the user has selected an interrupt frequency that is
not exactly the width of the counter, write a new value
into the counter such that it'll overflow after N more
events. */
if ((reg.need_reset >> which) & 1)
model->reset_ctr(®, which);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 38 | 77.55% | 1 | 50.00% |
Falk Hüffner | 11 | 22.45% | 1 | 50.00% |
Total | 49 | 100.00% | 2 | 100.00% |
static int
op_axp_setup(void)
{
unsigned long i, e;
/* Install our interrupt handler into the existing hook. */
save_perf_irq = perf_irq;
perf_irq = op_handle_interrupt;
/* Compute the mask of enabled counters. */
for (i = e = 0; i < model->num_counters; ++i)
if (ctr[i].enabled)
e |= 1 << i;
reg.enable = e;
/* Pre-compute the values to stuff in the hardware registers. */
model->reg_setup(®, ctr, &sys);
/* Configure the registers on all cpus. */
(void)smp_call_function(model->cpu_setup, ®, 1);
model->cpu_setup(®);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 99 | 96.12% | 1 | 33.33% |
Al Viro | 3 | 2.91% | 1 | 33.33% |
Andrew Morton | 1 | 0.97% | 1 | 33.33% |
Total | 103 | 100.00% | 3 | 100.00% |
static void
op_axp_shutdown(void)
{
/* Remove our interrupt handler. We may be removing this module. */
perf_irq = save_perf_irq;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 13 | 100.00% | 1 | 100.00% |
Total | 13 | 100.00% | 1 | 100.00% |
static void
op_axp_cpu_start(void *dummy)
{
wrperfmon(1, reg.enable);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 19 | 100.00% | 1 | 100.00% |
Total | 19 | 100.00% | 1 | 100.00% |
static int
op_axp_start(void)
{
(void)smp_call_function(op_axp_cpu_start, NULL, 1);
op_axp_cpu_start(NULL);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 25 | 89.29% | 1 | 50.00% |
Al Viro | 3 | 10.71% | 1 | 50.00% |
Total | 28 | 100.00% | 2 | 100.00% |
static inline void
op_axp_cpu_stop(void *dummy)
{
/* Disable performance monitoring for all counters. */
wrperfmon(0, -1);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 20 | 100.00% | 1 | 100.00% |
Total | 20 | 100.00% | 1 | 100.00% |
static void
op_axp_stop(void)
{
(void)smp_call_function(op_axp_cpu_stop, NULL, 1);
op_axp_cpu_stop(NULL);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 22 | 88.00% | 1 | 50.00% |
Al Viro | 3 | 12.00% | 1 | 50.00% |
Total | 25 | 100.00% | 2 | 100.00% |
static int
op_axp_create_files(struct dentry *root)
{
int i;
for (i = 0; i < model->num_counters; ++i) {
struct dentry *dir;
char buf[4];
snprintf(buf, sizeof buf, "%d", i);
dir = oprofilefs_mkdir(root, buf);
oprofilefs_create_ulong(dir, "enabled", &ctr[i].enabled);
oprofilefs_create_ulong(dir, "event", &ctr[i].event);
oprofilefs_create_ulong(dir, "count", &ctr[i].count);
/* Dummies. */
oprofilefs_create_ulong(dir, "kernel", &ctr[i].kernel);
oprofilefs_create_ulong(dir, "user", &ctr[i].user);
oprofilefs_create_ulong(dir, "unit_mask", &ctr[i].unit_mask);
}
if (model->can_set_proc_mode) {
oprofilefs_create_ulong(root, "enable_pal",
&sys.enable_pal);
oprofilefs_create_ulong(root, "enable_kernel",
&sys.enable_kernel);
oprofilefs_create_ulong(root, "enable_user",
&sys.enable_user);
}
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 141 | 70.15% | 1 | 25.00% |
Falk Hüffner | 55 | 27.36% | 1 | 25.00% |
Al Viro | 4 | 1.99% | 1 | 25.00% |
Markus Armbruster | 1 | 0.50% | 1 | 25.00% |
Total | 201 | 100.00% | 4 | 100.00% |
int __init
oprofile_arch_init(struct oprofile_operations *ops)
{
struct op_axp_model *lmodel = NULL;
switch (implver()) {
case IMPLVER_EV4:
lmodel = &op_model_ev4;
break;
case IMPLVER_EV5:
/* 21164PC has a slightly different set of events.
Recognize the chip by the presence of the MAX insns. */
if (!amask(AMASK_MAX))
lmodel = &op_model_pca56;
else
lmodel = &op_model_ev5;
break;
case IMPLVER_EV6:
/* 21264A supports ProfileMe.
Recognize the chip by the presence of the CIX insns. */
if (!amask(AMASK_CIX))
lmodel = &op_model_ev67;
else
lmodel = &op_model_ev6;
break;
}
if (!lmodel)
return -ENODEV;
model = lmodel;
ops->create_files = op_axp_create_files;
ops->setup = op_axp_setup;
ops->shutdown = op_axp_shutdown;
ops->start = op_axp_start;
ops->stop = op_axp_stop;
ops->cpu_type = lmodel->cpu_type;
printk(KERN_INFO "oprofile: using %s performance monitoring.\n",
lmodel->cpu_type);
return 0;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 91 | 62.33% | 3 | 50.00% |
Greg Banks | 32 | 21.92% | 1 | 16.67% |
Falk Hüffner | 15 | 10.27% | 1 | 16.67% |
Akinobu Mita | 8 | 5.48% | 1 | 16.67% |
Total | 146 | 100.00% | 6 | 100.00% |
void
oprofile_arch_exit(void)
{
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
John Levon | 6 | 100.00% | 1 | 100.00% |
Total | 6 | 100.00% | 1 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Richard Henderson | 585 | 78.84% | 3 | 25.00% |
Falk Hüffner | 93 | 12.53% | 1 | 8.33% |
Greg Banks | 32 | 4.31% | 1 | 8.33% |
Al Viro | 13 | 1.75% | 2 | 16.67% |
Akinobu Mita | 8 | 1.08% | 1 | 8.33% |
John Levon | 6 | 0.81% | 1 | 8.33% |
Michael Cree | 3 | 0.40% | 1 | 8.33% |
Andrew Morton | 1 | 0.13% | 1 | 8.33% |
Markus Armbruster | 1 | 0.13% | 1 | 8.33% |
Total | 742 | 100.00% | 12 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.