diff options
Diffstat (limited to 'arch/x86/oprofile/op_model_athlon.c')
-rw-r--r-- | arch/x86/oprofile/op_model_athlon.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/arch/x86/oprofile/op_model_athlon.c b/arch/x86/oprofile/op_model_athlon.c index 2650b12a0c56..0d8390319797 100644 --- a/arch/x86/oprofile/op_model_athlon.c +++ b/arch/x86/oprofile/op_model_athlon.c | |||
@@ -446,13 +446,25 @@ static void clear_ibs_nmi(void) | |||
446 | on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1); | 446 | on_each_cpu(apic_clear_ibs_nmi_per_cpu, NULL, 1); |
447 | } | 447 | } |
448 | 448 | ||
449 | static int (*create_arch_files)(struct super_block * sb, struct dentry * root); | ||
450 | |||
449 | static int setup_ibs_files(struct super_block * sb, struct dentry * root) | 451 | static int setup_ibs_files(struct super_block * sb, struct dentry * root) |
450 | { | 452 | { |
451 | char buf[12]; | 453 | char buf[12]; |
452 | struct dentry *dir; | 454 | struct dentry *dir; |
455 | int ret = 0; | ||
456 | |||
457 | /* architecture specific files */ | ||
458 | if (create_arch_files) | ||
459 | ret = create_arch_files(sb, root); | ||
460 | |||
461 | if (ret) | ||
462 | return ret; | ||
453 | 463 | ||
454 | if (!ibs_allowed) | 464 | if (!ibs_allowed) |
455 | return 0; | 465 | return ret; |
466 | |||
467 | /* model specific files */ | ||
456 | 468 | ||
457 | /* setup some reasonable defaults */ | 469 | /* setup some reasonable defaults */ |
458 | ibs_config.max_cnt_fetch = 250000; | 470 | ibs_config.max_cnt_fetch = 250000; |
@@ -482,11 +494,15 @@ static int setup_ibs_files(struct super_block * sb, struct dentry * root) | |||
482 | 494 | ||
483 | static int op_amd_init(struct oprofile_operations *ops) | 495 | static int op_amd_init(struct oprofile_operations *ops) |
484 | { | 496 | { |
497 | setup_ibs(); | ||
498 | create_arch_files = ops->create_files; | ||
499 | ops->create_files = setup_ibs_files; | ||
485 | return 0; | 500 | return 0; |
486 | } | 501 | } |
487 | 502 | ||
488 | static void op_amd_exit(void) | 503 | static void op_amd_exit(void) |
489 | { | 504 | { |
505 | clear_ibs_nmi(); | ||
490 | } | 506 | } |
491 | 507 | ||
492 | struct op_x86_model_spec const op_amd_spec = { | 508 | struct op_x86_model_spec const op_amd_spec = { |