Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 113598
b: refs/heads/master
c: 270d3e1
h: refs/heads/master
v: v3
  • Loading branch information
Robert Richter authored and Ingo Molnar committed Jul 26, 2008
1 parent 45364ed commit ddbbb57
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc2bd7345b4e006a34c2ea3711d8c6b83cba50f7
refs/heads/master: 270d3e1a10e6ef85d5a085377e01d91dbcbe3726
14 changes: 8 additions & 6 deletions trunk/arch/x86/oprofile/nmi_int.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,19 +468,21 @@ int __init op_nmi_init(struct oprofile_operations *ops)
return -ENODEV;
}

/* default values, can be overwritten by model */
ops->create_files = nmi_create_files;
ops->setup = nmi_setup;
ops->shutdown = nmi_shutdown;
ops->start = nmi_start;
ops->stop = nmi_stop;
ops->cpu_type = cpu_type;

if (model->init)
ret = model->init(ops);
if (ret)
return ret;

init_sysfs();
using_nmi = 1;
ops->create_files = nmi_create_files;
ops->setup = nmi_setup;
ops->shutdown = nmi_shutdown;
ops->start = nmi_start;
ops->stop = nmi_stop;
ops->cpu_type = cpu_type;
printk(KERN_INFO "oprofile: using NMI interrupt.\n");
return 0;
}
Expand Down
18 changes: 17 additions & 1 deletion trunk/arch/x86/oprofile/op_model_athlon.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,25 @@ static void clear_ibs_nmi(void)
on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1);
}

static int (*create_arch_files)(struct super_block * sb, struct dentry * root);

static int setup_ibs_files(struct super_block * sb, struct dentry * root)
{
char buf[12];
struct dentry *dir;
int ret = 0;

/* architecture specific files */
if (create_arch_files)
ret = create_arch_files(sb, root);

if (ret)
return ret;

if (!ibs_allowed)
return 0;
return ret;

/* model specific files */

/* setup some reasonable defaults */
ibs_config.max_cnt_fetch = 250000;
Expand Down Expand Up @@ -482,11 +494,15 @@ static int setup_ibs_files(struct super_block * sb, struct dentry * root)

static int op_amd_init(struct oprofile_operations *ops)
{
setup_ibs();
create_arch_files = ops->create_files;
ops->create_files = setup_ibs_files;
return 0;
}

static void op_amd_exit(void)
{
clear_ibs_nmi();
}

struct op_x86_model_spec const op_amd_spec = {
Expand Down

0 comments on commit ddbbb57

Please sign in to comment.