Commit 1f935de0 authored by John Levon's avatar John Levon Committed by Linus Torvalds

[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).
parent 515ad669
...@@ -68,8 +68,12 @@ static int mm_notify(struct notifier_block * self, unsigned long val, void * dat ...@@ -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) static int module_load_notify(struct notifier_block * self, unsigned long val, void * data)
{ {
#ifdef CONFIG_MODULES
if (val != MODULE_STATE_COMING) if (val != MODULE_STATE_COMING)
return 0; return 0;
...@@ -78,9 +82,11 @@ static int module_load_notify(struct notifier_block * self, unsigned long val, v ...@@ -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(ESCAPE_CODE);
add_event_entry(MODULE_LOADED_CODE); add_event_entry(MODULE_LOADED_CODE);
up(&buffer_sem); up(&buffer_sem);
#endif
return 0; return 0;
} }
static struct notifier_block exit_task_nb = { static struct notifier_block exit_task_nb = {
.notifier_call = exit_task_notify, .notifier_call = exit_task_notify,
}; };
...@@ -92,7 +98,7 @@ static struct notifier_block exec_unmap_nb = { ...@@ -92,7 +98,7 @@ static struct notifier_block exec_unmap_nb = {
static struct notifier_block exit_mmap_nb = { static struct notifier_block exit_mmap_nb = {
.notifier_call = mm_notify, .notifier_call = mm_notify,
}; };
static struct notifier_block module_load_nb = { static struct notifier_block module_load_nb = {
.notifier_call = module_load_notify, .notifier_call = module_load_notify,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment