From: Philippe E. <ph...@us...> - 2002-07-04 23:23:47
|
Update of /cvsroot/oprofile/oprofile/module/x86 In directory usw-pr-cvs1:/tmp/cvs-serv14406/module/x86 Modified Files: op_nmi.c Log Message: various minor cleanup removing a few FIXME pp: add --objdump-params to op_to_source See ChangeLog for further information regards, Phil Index: op_nmi.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/module/x86/op_nmi.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- op_nmi.c 26 Jun 2002 04:09:58 -0000 1.8 +++ op_nmi.c 4 Jul 2002 23:23:44 -0000 1.9 @@ -264,31 +264,27 @@ int ok = 0; for (i = 0; i < op_nr_counters ; i++) { + int min_count; + int ret; - if (sysctl.ctr[i].enabled) { - int min_count = op_min_count(sysctl.ctr[i].event, sysctl.cpu_type); + if (!sysctl.ctr[i].enabled) + continue; - if (!sysctl.ctr[i].user && !sysctl.ctr[i].kernel) { - printk(KERN_ERR "oprofile: neither kernel nor user " - "set for counter %d\n", i); - return 0; - } - if (check_range(sysctl.ctr[i].count, min_count, - OP_MAX_PERF_COUNT, - "ctr count value %d not in range (%d %ld)\n")) - return 0; + enabled = 1; - enabled = 1; + if (!sysctl.ctr[i].user && !sysctl.ctr[i].kernel) { + printk(KERN_ERR "oprofile: neither kernel nor user " + "set for counter %d\n", i); + return -EINVAL; } - } - if (!enabled) { - printk(KERN_ERR "oprofile: no counters have been enabled.\n"); - return -EINVAL; - } + min_count = op_min_count(sysctl.ctr[i].event, sysctl.cpu_type); + if (check_range(sysctl.ctr[i].count, min_count, + OP_MAX_PERF_COUNT, + "ctr count value %d not in range (%d %ld)\n")) + return -EINVAL; - for (i = 0 ; i < op_nr_counters ; ++i) { - int ret = op_check_events(i, sysctl.ctr[i].event, sysctl.ctr[i].unit_mask, sysctl.cpu_type); + ret = op_check_events(i, sysctl.ctr[i].event, sysctl.ctr[i].unit_mask, sysctl.cpu_type); if (ret & OP_INVALID_EVENT) { printk(KERN_ERR "oprofile: ctr%d: %d: no such event for cpu %d\n", i, @@ -305,6 +301,11 @@ if (ret != OP_OK_EVENT) ok = -EINVAL; + } + + if (!enabled) { + printk(KERN_ERR "oprofile: no counters have been enabled.\n"); + return -EINVAL; } return ok; |