From dan@kulesh.obluda.cz  Sat Jan  5 13:22:54 2008
Return-Path: <dan@kulesh.obluda.cz>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id E24F816A419
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 Jan 2008 13:22:54 +0000 (UTC)
	(envelope-from dan@kulesh.obluda.cz)
Received: from smtp1.kolej.mff.cuni.cz (smtp1.kolej.mff.cuni.cz [78.128.192.10])
	by mx1.freebsd.org (Postfix) with ESMTP id 7B00913C43E
	for <FreeBSD-gnats-submit@freebsd.org>; Sat,  5 Jan 2008 13:22:54 +0000 (UTC)
	(envelope-from dan@kulesh.obluda.cz)
Received: from kulesh.obluda.cz (openvpn.ms.mff.cuni.cz [195.113.20.87])
	by smtp1.kolej.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id m05DMc3Z056560
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 5 Jan 2008 14:22:40 +0100 (CET)
	(envelope-from dan@kulesh.obluda.cz)
Received: from kulesh.obluda.cz (localhost. [127.0.0.1])
	by kulesh.obluda.cz (8.14.2/8.14.2) with ESMTP id m05DMcmQ041439
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 5 Jan 2008 14:22:38 +0100 (CET)
	(envelope-from dan@kulesh.obluda.cz)
Received: (from root@localhost)
	by kulesh.obluda.cz (8.14.2/8.14.1/Submit) id m05DMcuC041438;
	Sat, 5 Jan 2008 14:22:38 +0100 (CET)
	(envelope-from dan)
Message-Id: <200801051322.m05DMcuC041438@kulesh.obluda.cz>
Date: Sat, 5 Jan 2008 14:22:38 +0100 (CET)
From: Dan Lukes <dan@obluda.cz>
Reply-To: Dan Lukes <dan@obluda.cz>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: SYSINIT_VERBOSE can be more verbose
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         119358
>Category:       kern
>Synopsis:       [kernel] [patch] SYSINIT_VERBOSE can be more verbose
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 05 13:30:01 UTC 2008
>Closed-Date:    
>Last-Modified:  Sat Jan 05 13:52:48 UTC 2008
>Originator:     Dan Lukes
>Release:        FreeBSD 6.3-PRERELEASE i386
>Organization:
Obludarium
>Environment:
System: FreeBSD kulesh.obluda.cz 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #14: Sat Jan 5 10:46:19 CET 2008 dan@kulesh.obluda.cz:/usr/obj/usr/src/sys/KULESH i386
but it apply to RELENG_7 and HEAD as well


>Description:
	the SYSINIT_VERBOSE will push the mi_startup() to display
	the progress of system startup

	Due current implementation logic, the SI_SUB_COPYRIGHT level message
are not displayed althought it can be. 

	Also, not only functions but it's parameters also can be DDB-resolved
to names if DDB present.

>How-To-Repeat:
>Fix:

	SI_SUB_COPYRIGHT messages will be displayed if 'last' variable will be
initialized to SI_SUB_COPYRIGHT-1 (now it's initialized to SI_SUB_COPYRIGHT)

	Other changes resolve the function parameter to name.


--- sys/kern/init_main.c.ORIG	2008-01-05 12:44:57.000000000 +0100
+++ sys/kern/init_main.c	2008-01-05 13:01:42.000000000 +0100
@@ -200,7 +200,7 @@
 	}
 
 #if defined(VERBOSE_SYSINIT)
-	last = SI_SUB_COPYRIGHT;
+	last = SI_SUB_COPYRIGHT-1;
 	verbose = 0;
 #if !defined(DDB)
 	printf("VERBOSE_SYSINIT: DDB not enabled, symbol lookups disabled.\n");
@@ -231,18 +231,31 @@
 		if (verbose) {
 #if defined(DDB)
 			const char *name;
+			const char *pname;
 			c_db_sym_t sym;
 			db_expr_t  offset;
 
 			sym = db_search_symbol((vm_offset_t)(*sipp)->func,
 			    DB_STGY_PROC, &offset);
 			db_symbol_values(sym, &name, NULL);
+			sym = db_search_symbol((vm_offset_t)(*sipp)->udata,
+			    DB_STGY_ANY, &offset);
+			if (offset == 0)
+				db_symbol_values(sym, &pname, NULL);
+			else
+				pname=NULL;
+				
 			if (name != NULL)
-				printf("   %s(%p)... ", name, (*sipp)->udata);
+				printf("   %s", name);
+			else
+#endif
+				printf("   %p", (*sipp)->func);
+#if defined(DDB)
+			if (pname != NULL)
+				printf("(%s=%p)... ", pname, (*sipp)->udata);
 			else
 #endif
-				printf("   %p(%p)... ", (*sipp)->func,
-				    (*sipp)->udata);
+				printf("(%p)... ", (*sipp)->udata);
 		}
 #endif
 
@@ -265,6 +278,10 @@
 			sysinit_end = newsysinit_end;
 			newsysinit = NULL;
 			newsysinit_end = NULL;
+#if defined(VERBOSE_SYSINIT)
+			if (verbose)
+				printf("VERBOSE_SYSINIT: new sysinit set found, processing restarted.\n");
+#endif
 			goto restart;
 		}
 	}
>Release-Note:
>Audit-Trail:
>Unformatted:
