From: John L. <mov...@us...> - 2001-09-02 14:34:46
|
Update of /cvsroot/oprofile/oprofile In directory usw-pr-cvs1:/tmp/cvs-serv21339 Modified Files: ChangeLog oprofile.c Log Message: don't unload on SMP Index: ChangeLog =================================================================== RCS file: /cvsroot/oprofile/oprofile/ChangeLog,v retrieving revision 1.95 retrieving revision 1.96 diff -u -d -r1.95 -r1.96 --- ChangeLog 2001/09/02 01:08:45 1.95 +++ ChangeLog 2001/09/02 14:34:44 1.96 @@ -1,5 +1,10 @@ 2001-09-02 John Levon <mo...@co...> + * oprofile.c: don't allow unload on SMP unless allow_unload + is set. Still needs docs (no point till SMP works). + +2001-09-02 John Levon <mo...@co...> + * dae/op_dump: complain if not root more clearly. 2001-09-02 John Levon <mo...@co...> Index: oprofile.c =================================================================== RCS file: /cvsroot/oprofile/oprofile/oprofile.c,v retrieving revision 1.78 retrieving revision 1.79 diff -u -d -r1.78 -r1.79 --- oprofile.c 2001/09/02 00:38:04 1.78 +++ oprofile.c 2001/09/02 14:34:44 1.79 @@ -23,6 +23,12 @@ MODULE_AUTHOR("John Levon (mo...@co...)"); MODULE_DESCRIPTION("Continuous Profiling Module"); +#ifdef CONFIG_SMP +MODULE_PARM(allow_unload, "i"); +MODULE_PARM_DESC(allow_unload, "Allow module to be unloaded on SMP"); +static int allow_unload; +#endif + /* sysctl settables */ static int op_hash_size=OP_DEFAULT_HASH_SIZE; static int op_buf_size=OP_DEFAULT_BUF_SIZE; @@ -1211,6 +1217,12 @@ 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)) can = 0; up(&sysctlsem); |