X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fi386%2Foprofile%2Fnmi_int.c;fp=arch%2Fi386%2Foprofile%2Fnmi_int.c;h=0493e8b8ec49266618b155fb3490f02854dc70db;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=5f8dc8a21bd7157e2fa9e40a6b18422fc0ed2c00;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c index 5f8dc8a21..0493e8b8e 100644 --- a/arch/i386/oprofile/nmi_int.c +++ b/arch/i386/oprofile/nmi_int.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -123,7 +122,7 @@ static void nmi_save_registers(void * dummy) static void free_msrs(void) { int i; - for_each_possible_cpu(i) { + for (i = 0; i < NR_CPUS; ++i) { kfree(cpu_msrs[i].counters); cpu_msrs[i].counters = NULL; kfree(cpu_msrs[i].controls); @@ -139,7 +138,10 @@ static int allocate_msrs(void) size_t counters_size = sizeof(struct op_msr) * model->num_counters; int i; - for_each_online_cpu(i) { + for (i = 0; i < NR_CPUS; ++i) { + if (!cpu_online(i)) + continue; + cpu_msrs[i].counters = kmalloc(counters_size, GFP_KERNEL); if (!cpu_msrs[i].counters) { success = 0; @@ -282,9 +284,9 @@ static int nmi_create_files(struct super_block * sb, struct dentry * root) for (i = 0; i < model->num_counters; ++i) { struct dentry * dir; - char buf[4]; + char buf[2]; - snprintf(buf, sizeof(buf), "%d", i); + snprintf(buf, 2, "%d", i); dir = oprofilefs_mkdir(sb, root, buf); oprofilefs_create_ulong(sb, dir, "enabled", &counter_config[i].enabled); oprofilefs_create_ulong(sb, dir, "event", &counter_config[i].event); @@ -297,14 +299,12 @@ static int nmi_create_files(struct super_block * sb, struct dentry * root) return 0; } -static int p4force; -module_param(p4force, int, 0); static int __init p4_init(char ** cpu_type) { __u8 cpu_model = boot_cpu_data.x86_model; - if (!p4force && (cpu_model > 6 || cpu_model == 5)) + if (cpu_model > 4) return 0; #ifndef CONFIG_SMP @@ -335,13 +335,10 @@ static int __init ppro_init(char ** cpu_type) { __u8 cpu_model = boot_cpu_data.x86_model; - if (cpu_model == 14) - *cpu_type = "i386/core"; - else if (cpu_model == 15) - *cpu_type = "i386/core_2"; - else if (cpu_model > 0xd) + if (cpu_model > 0xd) return 0; - else if (cpu_model == 9) { + + if (cpu_model == 9) { *cpu_type = "i386/p6_mobile"; } else if (cpu_model > 5) { *cpu_type = "i386/piii";