Date: Sat, 18 Jan 2003 14:38:45 -0800 From: Terry Lambert <tlambert2@mindspring.com> To: Arun Sharma <arun@sharma-home.net> Cc: hackers@freebsd.org Subject: Re: listing sysinit order ? Message-ID: <3E29D775.EA2323A9@mindspring.com> References: <20030118203706.GA21624@sharma-home.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E29D775.EA2323A9>