From owner-freebsd-hackers Sat Jan 18 14:40: 9 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 ED91337B401 for ; Sat, 18 Jan 2003 14:40:07 -0800 (PST) Received: from bluejay.mail.pas.earthlink.net (bluejay.mail.pas.earthlink.net [207.217.120.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7F6E243F18 for ; Sat, 18 Jan 2003 14:40:07 -0800 (PST) (envelope-from tlambert2@mindspring.com) Received: from pool0068.cvx21-bradley.dialup.earthlink.net ([209.179.192.68] helo=mindspring.com) by bluejay.mail.pas.earthlink.net with asmtp (SSLv3:RC4-MD5:128) (Exim 3.33 #1) id 18a1dE-0007au-00; Sat, 18 Jan 2003 14:40:05 -0800 Message-ID: <3E29D775.EA2323A9@mindspring.com> Date: Sat, 18 Jan 2003 14:38:45 -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> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-ELNK-Trace: b1a02af9316fbb217a47c185c03b154d40683398e744b8a43a6040f1c1623a756601fe2bc2dba2bc666fa475841a1c7a350badd9bab72f9c350badd9bab72f9c 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: > 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 The SYSINIT elements are bubble sorted by a primary key, the subsystem identifier (sysinit_sub_id), and then by a secondary key, the substem element order specifier (sysinit_elem_order). Sort order is from smallest value to largest. This happens once in the lifetime of the OS, so a bubble sort is not significant overhead, relative to, say, the first thing that gets called to initialize something. It's actually useful, on occasion, to printf each element before it's called, to identify where something is hanging. 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. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message