Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Add some additional status messages for kern.module...



details:   https://anonhg.NetBSD.org/src/rev/74b5cc83a98b
branches:  trunk
changeset: 341374:74b5cc83a98b
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Tue Nov 03 02:04:12 2015 +0000

description:
Add some additional status messages for kern.module.verbose=TRUE

diffstat:

 sys/kern/kern_module.c |  19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diffs (74 lines):

diff -r 6fbe90cfcfd8 -r 74b5cc83a98b sys/kern/kern_module.c
--- a/sys/kern/kern_module.c    Mon Nov 02 22:21:26 2015 +0000
+++ b/sys/kern/kern_module.c    Tue Nov 03 02:04:12 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_module.c,v 1.106 2015/06/22 16:35:13 matt Exp $   */
+/*     $NetBSD: kern_module.c,v 1.107 2015/11/03 02:04:12 pgoyette Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.106 2015/06/22 16:35:13 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.107 2015/11/03 02:04:12 pgoyette Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -945,6 +945,8 @@
                                if (modp != NULL) {
                                        *modp = mod;
                                }
+                               module_print("dependent module `%s' already "
+                                   "loaded", name);
                                depth--;
                                return 0;
                        }
@@ -1153,6 +1155,7 @@
                module_thread_kick();
        }
        depth--;
+       module_print("module `%s' loaded successfully", mi->mi_name);
        return 0;
 
  fail:
@@ -1183,13 +1186,16 @@
        KASSERT(kernconfig_is_held());
        KASSERT(name != NULL);
 
+       module_print("unload requested for '%s' (%s)", name,
+           load_requires_force?"TRUE":"FALSE");
        mod = module_lookup(name);
        if (mod == NULL) {
                module_error("module `%s' not found", name);
                return ENOENT;
        }
        if (mod->mod_refcnt != 0) {
-               module_print("module `%s' busy", name);
+               module_print("module `%s' busy (%d refs)", name,
+                   mod->mod_refcnt));
                return EBUSY;
        }
 
@@ -1198,6 +1204,8 @@
         */
        if (mod->mod_source == MODULE_SOURCE_KERNEL &&
            mod->mod_info->mi_class == MODULE_CLASS_SECMODEL) {
+               module_print("cannot unload built-in secmodel module `%s'",
+                   name);
                return EPERM;
        }
 
@@ -1369,7 +1377,10 @@
                        error = (*mi->mi_modcmd)(MODULE_CMD_AUTOUNLOAD, NULL);
                        if (error == 0 || error == ENOTTY) {
                                (void)module_do_unload(mi->mi_name, false);
-                       }
+                       } else
+                               module_print("module `%s' declined to be "
+                                   "auto-unloaded error=%d", mi->mi_name,
+                                   error);
                }
                kernconfig_unlock();
 



Home | Main Index | Thread Index | Old Index