From 1f935de0912d7b23fde7e8f24098219524bd506a Mon Sep 17 00:00:00 2001 From: John Levon Date: Fri, 4 Apr 2003 04:16:28 -0800 Subject: [PATCH] [PATCH] oprofile doesn't compile with CONFIG_MODULES=n The semantically correct approach is for register_module_notifier not to exist at all. That way is #ifdef hell. So this just makes it an empty function (and also adds a missing comment). --- drivers/oprofile/buffer_sync.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c index 14f2ad612a4c6..392fc1729a274 100644 --- a/drivers/oprofile/buffer_sync.c +++ b/drivers/oprofile/buffer_sync.c @@ -68,8 +68,12 @@ static int mm_notify(struct notifier_block * self, unsigned long val, void * dat } +/* We need to be told about new modules so we don't attribute to a previously + * loaded module, or drop the samples on the floor. + */ static int module_load_notify(struct notifier_block * self, unsigned long val, void * data) { +#ifdef CONFIG_MODULES if (val != MODULE_STATE_COMING) return 0; @@ -78,9 +82,11 @@ static int module_load_notify(struct notifier_block * self, unsigned long val, v add_event_entry(ESCAPE_CODE); add_event_entry(MODULE_LOADED_CODE); up(&buffer_sem); +#endif return 0; } + static struct notifier_block exit_task_nb = { .notifier_call = exit_task_notify, }; @@ -92,7 +98,7 @@ static struct notifier_block exec_unmap_nb = { static struct notifier_block exit_mmap_nb = { .notifier_call = mm_notify, }; - + static struct notifier_block module_load_nb = { .notifier_call = module_load_notify, }; -- 2.53.0