From owner-freebsd-hackers Sun Jan 19 5:10:43 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A8A9037B401 for ; Sun, 19 Jan 2003 05:10:41 -0800 (PST) Received: from heron.mail.pas.earthlink.net (heron.mail.pas.earthlink.net [207.217.120.189]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C83243F13 for ; Sun, 19 Jan 2003 05:10:41 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0034.cvx21-bradley.dialup.earthlink.net ([209.179.192.34] helo=mindspring.com) by heron.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18aFDi-00057w-00; Sun, 19 Jan 2003 05:10:39 -0800 Message-ID: <3E2AA0A9.C8386AED@mindspring.com> Date: Sun, 19 Jan 2003 04:57:13 -0800 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Arun Sharma Cc: hackers@freebsd.org Subject: Re: listing sysinit order ? References: <20030118203706.GA21624@sharma-home.net> <3E29D775.EA2323A9@mindspring.com> <3E29DDDB.6000906@sharma-home.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a40fc8718038de15868b5643a3b761107893caf27dac41a8fd350badd9bab72f9c350badd9bab72f9c Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Arun Sharma wrote: > Terry Lambert wrote: > > Arun Sharma wrote: > > > >>So my question is, is there a simple tool to list the order in which > >>various initialization/probe routines get called in mi_startup ? If not, > >>what would it take to write one ? > > > > more /sys/sys/kernel.h > > Yes, I'm aware of this one, but it doesn't tell me very pricisely which > drivers get initialized in what order. They get initialized by the ordinal value of the initializer; if you know the ordinal value, then you can know the driver. If you are asking for a reverse map... it's not there. That's because the kernel doesn't know what's linked into it (or we would not have needed SYSINIT in the first place). If you are asking for a reverse map, the closes you are going to get is: find /sys -name \*.x | xargs fgrep SYSINIT | more > > You can not cause messages to be printed until after SI_SUB_CONSOLE; > > if you want to put a printf in the init_main.c, verify that the > > sysinit_sub_id is > SI_SUB_CONSOLE before attempting to call the > > printf. > > At that point only a function pointer is available. Is there a good way > of converting it into a printable string ? No, actually, it's a sysinit structure. The function pointer is only one member, e.g.: if ((*sipp)->subsystem == SI_SUB_DONE) continue; /* Call function */ (*((*sipp)->func))((*sipp)->udata); If you change this to: if ((*sipp)->subsystem == SI_SUB_DONE) continue; if ((*sipp)->subsystem > SI_SUB_CONSOLE) printf( "init_main: SYSINIT %d %s\n", (*sipp)->subsystem, (*sipp)->order); /* Call function */ (*((*sipp)->func))((*sipp)->udata); You will get the information you seem to be asking for (unless I'm misunderstanding you, and you are trying to lead upo asking for a string identifier, and for some reason you don't want to come out and ask for a modification of the SYSINIT macro, for some reason...). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message