Reducing noise in dmesg output

From: Nick Hibma <nick_at_van-laarhoven.org>
Date: Tue, 1 Sep 2009 09:31:16 +0200
Folks,

dmesg is getting cluttered with random bits of irrelevant information which 
either should be behind bootverbose or not at all present. Below two 
locations where I intend to remove that information. The fact that a module 
is loaded can be seen in the output of

	kldstat -v | grep netsmb

the amount of stolen memory and aperture size might be interesting when 
configuring your X server. Then again, most X servers nowadays HAVE no 
configuration file anymore because of auto-configuration.

Any objections?

Nick

Index: kern/kern_shutdown.c
===================================================================
--- kern/kern_shutdown.c	(revision 196710)
+++ kern/kern_shutdown.c	(working copy)
_at__at_ -581,6 +581,10 _at__at_
 
 /*
  * Support for poweroff delay.
+ *
+ * Please note that setting this delay too short might power off your 
machine
+ * before the write cache on your hard disk has been flushed, leading to
+ * soft-updates inconsistencies.
  */
 #ifndef POWEROFF_DELAY
 # define POWEROFF_DELAY 5000
Index: dev/agp/agp_i810.c
===================================================================
--- dev/agp/agp_i810.c	(revision 196589)
+++ dev/agp/agp_i810.c	(working copy)
_at__at_ -474,12 +474,15 _at__at_
 				agp_generic_detach(dev);
 				return EINVAL;
 		}
-		if (sc->stolen > 0) {
-			device_printf(dev, "detected %dk stolen memory\n",
-			    sc->stolen * 4);
+		if (bootverbose) {
+			if (sc->stolen > 0) {
+				device_printf(dev,
+				    "detected %dk stolen memory\n",
+				    sc->stolen * 4);
+			}
+			device_printf(dev, "aperture size is %dM\n",
+			    sc->initial_aperture / 1024 / 1024);
 		}
-		device_printf(dev, "aperture size is %dM\n",
-		    sc->initial_aperture / 1024 / 1024);
 
 		/* GATT address is already in there, make sure it's enabled */
 		pgtblctl = bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL);
_at__at_ -664,9 +667,11 _at__at_
 		gtt_size += 4;
 
 		sc->stolen = (stolen - gtt_size) * 1024 / 4096;
-		if (sc->stolen > 0)
-			device_printf(dev, "detected %dk stolen memory\n", sc->stolen * 4);
-		device_printf(dev, "aperture size is %dM\n", sc->initial_aperture / 1024 
/ 1024);
+		if (bootverbose) {
+			if (sc->stolen > 0)
+				device_printf(dev, "detected %dk stolen memory\n", sc->stolen * 4);
+			device_printf(dev, "aperture size is %dM\n", sc->initial_aperture / 1024 
/ 1024);
+		}
 
 		/* GATT address is already in there, make sure it's enabled */
 		pgtblctl = bus_read_4(sc->sc_res[0], AGP_I810_PGTBL_CTL);
Index: netsmb/smb_dev.c
===================================================================
--- netsmb/smb_dev.c	(revision 196589)
+++ netsmb/smb_dev.c	(working copy)
_at__at_ -352,7 +352,6 _at__at_
 		}
 		clone_setup(&nsmb_clones);
 		nsmb_dev_tag = EVENTHANDLER_REGISTER(dev_clone, nsmb_dev_clone, 0, 1000);
-		printf("netsmb_dev: loaded\n");
 		break;
 	    case MOD_UNLOAD:
 		smb_iod_done();
_at__at_ -363,7 +362,6 _at__at_
 		drain_dev_clone_events();
 		clone_cleanup(&nsmb_clones);
 		destroy_dev_drain(&nsmb_cdevsw);
-		printf("netsmb_dev: unloaded\n");
 		break;
 	    default:
 		error = EINVAL;
Received on Tue Sep 01 2009 - 05:31:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:54 UTC