]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] oprofile doesn't compile with CONFIG_MODULES=n
authorJohn Levon <levon@movementarian.org>
Fri, 4 Apr 2003 12:16:28 +0000 (04:16 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Fri, 4 Apr 2003 12:16:28 +0000 (04:16 -0800)
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

index 14f2ad612a4c658d0dfbadf27fc010312c3779e2..392fc1729a2747913b0a42bb5cb05d1cfe726c76 100644 (file)
@@ -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,
 };