/**
* @file nmi_int.c
*
- * @remark Copyright 2002 OProfile authors
+ * @remark Copyright 2002-2008 OProfile authors
* @remark Read the file COPYING
*
* @author John Levon <levon@movementarian.org>
+ * @author Robert Richter <robert.richter@amd.com>
*/
#include <linux/init.h>
__u8 vendor = boot_cpu_data.x86_vendor;
__u8 family = boot_cpu_data.x86;
char *cpu_type;
+ int ret = 0;
if (!cpu_has_apic)
return -ENODEV;
return -ENODEV;
}
+ if (model->init)
+ ret = model->init(ops);
+ if (ret)
+ return ret;
+
init_sysfs();
using_nmi = 1;
ops->create_files = nmi_create_files;
{
if (using_nmi)
exit_sysfs();
+ if (model->exit)
+ model->exit();
}
/*
- * @file op_model_athlon.h
+ * @file op_model_athlon.c
* athlon / K7 / K8 / Family 10h model-specific MSR operations
*
- * @remark Copyright 2002 OProfile authors
+ * @remark Copyright 2002-2008 OProfile authors
* @remark Read the file COPYING
*
* @author John Levon
* @author Philippe Elie
* @author Graydon Hoare
- */
+ * @author Robert Richter <robert.richter@amd.com>
+*/
#include <linux/oprofile.h>
#include <asm/ptrace.h>
}
}
+static int op_amd_init(struct oprofile_operations *ops)
+{
+ return 0;
+}
+
+static void op_amd_exit(void)
+{
+}
+
struct op_x86_model_spec const op_athlon_spec = {
+ .init = op_amd_init,
+ .exit = op_amd_exit,
.num_counters = NUM_COUNTERS,
.num_controls = NUM_CONTROLS,
.fill_in_addresses = &athlon_fill_in_addresses,
* various x86 CPU models' perfctr support.
*/
struct op_x86_model_spec {
+ int (*init)(struct oprofile_operations *ops);
+ void (*exit)(void);
unsigned int const num_counters;
unsigned int const num_controls;
void (*fill_in_addresses)(struct op_msrs * const msrs);