From: John L. <mov...@us...> - 2001-09-04 21:11:03
|
Update of /cvsroot/oprofile/oprofile In directory usw-pr-cvs1:/tmp/cvs-serv29011 Modified Files: ChangeLog oprofile.c oprofile.h Log Message: a couple of fixes Index: ChangeLog =================================================================== RCS file: /cvsroot/oprofile/oprofile/ChangeLog,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- ChangeLog 2001/09/04 17:30:12 1.99 +++ ChangeLog 2001/09/04 21:11:00 1.100 @@ -1,5 +1,11 @@ 2001-09-04 John Levon <mo...@co...> + * oprofile.h: + * oprofile.c: don't restore delivery mode to LVTPC (causes + APIC error on SMP). Fix for silly sem hang with do_dump + +2001-09-04 John Levon <mo...@co...> + * dae/op_start: fix typo bug 2001-09-04 John Levon <mo...@co...> Index: oprofile.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/oprofile.c,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- oprofile.c 2001/09/04 12:50:10 1.80 +++ oprofile.c 2001/09/04 21:11:00 1.81 @@ -263,7 +263,8 @@ static void __exit lvtpc_apic_restore(void *dummy) { uint val = apic_read(APIC_LVTPC); - val = SET_APIC_DELIVERY_MODE(val, lvtpc_old_mode[smp_processor_id()]); + // FIXME: this gives APIC errors on SMP hardware. + // val = SET_APIC_DELIVERY_MODE(val, lvtpc_old_mode[smp_processor_id()]); if (lvtpc_old_mask[smp_processor_id()]) val |= APIC_LVT_MASKED; else @@ -1226,13 +1227,7 @@ int can = -EBUSY; down(&sysctlsem); -/* the module unload race can currently only happen on SMP */ -#ifdef CONFIG_SMP - if (!allow_unload) - return -EBUSY; -#endif - - if (!prof_on && !GET_USE_COUNT(THIS_MODULE)) + if (smp_can_unload() && !prof_on && !GET_USE_COUNT(THIS_MODULE)) can = 0; up(&sysctlsem); return can; Index: oprofile.h =================================================================== RCS file: /cvsroot/oprofile/oprofile/oprofile.h,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- oprofile.h 2001/09/01 02:03:34 1.48 +++ oprofile.h 2001/09/04 21:11:00 1.49 @@ -172,6 +172,13 @@ struct _descr { u16 limit; u32 base; } __attribute__((__packed__)); struct _idt_descr { u32 a; u32 b; } __attribute__((__packed__)); +/* we can't unload safely on SMP */ +#ifdef CONFIG_SMP +#define smp_can_unload() (allow_unload) +#else +#define smp_can_unload() 1 +#endif + // 2.4.3 introduced rw mmap semaphore #if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,3) #define take_mmap_sem(mm) down(&mm->mmap_sem) |