From owner-svn-src-stable@FreeBSD.ORG Thu Jun 28 19:34:24 2012 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 547B81065670; Thu, 28 Jun 2012 19:34:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2490B8FC08; Thu, 28 Jun 2012 19:34:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5SJYOK2094598; Thu, 28 Jun 2012 19:34:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5SJYNHn094596; Thu, 28 Jun 2012 19:34:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201206281934.q5SJYNHn094596@svn.freebsd.org> From: John Baldwin Date: Thu, 28 Jun 2012 19:34:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237725 - stable/9/sys/kern X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Jun 2012 19:34:24 -0000 Author: jhb Date: Thu Jun 28 19:34:23 2012 New Revision: 237725 URL: http://svn.freebsd.org/changeset/base/237725 Log: MFC 236404: Extend VERBOSE_SYSINIT to also print out the name of variables passed to SYSINIT routines if they can be resolved via symbol look up in DDB. To avoid false positives, only honor a name if the symbol resolves exactly to the pointer value (no offset). Modified: stable/9/sys/kern/init_main.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/kern/init_main.c ============================================================================== --- stable/9/sys/kern/init_main.c Thu Jun 28 19:27:54 2012 (r237724) +++ stable/9/sys/kern/init_main.c Thu Jun 28 19:34:23 2012 (r237725) @@ -158,6 +158,24 @@ sysinit_add(struct sysinit **set, struct newsysinit_end = newset + count; } +#if defined (DDB) && defined(VERBOSE_SYSINIT) +static const char * +symbol_name(vm_offset_t va, db_strategy_t strategy) +{ + const char *name; + c_db_sym_t sym; + db_expr_t offset; + + if (va == 0) + return (NULL); + sym = db_search_symbol(va, strategy, &offset); + if (offset != 0) + return (NULL); + db_symbol_values(sym, &name, NULL); + return (name); +} +#endif + /* * System startup; initialize the world, create process 0, mount root * filesystem, and fork to create init and pagedaemon. Most of the @@ -238,15 +256,16 @@ restart: } if (verbose) { #if defined(DDB) - const char *name; - 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); - if (name != NULL) - printf(" %s(%p)... ", name, (*sipp)->udata); + const char *func, *data; + + func = symbol_name((vm_offset_t)(*sipp)->func, + DB_STGY_PROC); + data = symbol_name((vm_offset_t)(*sipp)->udata, + DB_STGY_ANY); + if (func != NULL && data != NULL) + printf(" %s(&%s)... ", func, data); + else if (func != NULL) + printf(" %s(%p)... ", func, (*sipp)->udata); else #endif printf(" %p(%p)... ", (*sipp)->func,