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 [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to