]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[init] Show startup and shutdown function names in debug messages
authorMichael Brown <mcb30@ipxe.org>
Fri, 25 Jan 2019 14:53:43 +0000 (14:53 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 25 Jan 2019 14:53:43 +0000 (14:53 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
19 files changed:
src/arch/x86/core/cachedhcp.c
src/arch/x86/core/runtime.c
src/arch/x86/drivers/net/undionly.c
src/arch/x86/image/initrd.c
src/arch/x86/interface/pcbios/bios_console.c
src/arch/x86/interface/pcbios/hidemem.c
src/core/device.c
src/core/init.c
src/core/malloc.c
src/core/serial.c
src/crypto/rbg.c
src/crypto/rootcert.c
src/drivers/usb/ehci.c
src/drivers/usb/xhci.c
src/hci/linux_args.c
src/include/ipxe/init.h
src/interface/efi/efi_timer.c
src/interface/linux/linux_console.c
src/net/tcp.c

index ff35b9256959bf1139696eae8f1521d9b287a3ac..dffafe3c93c23ea1d3de0b2764fb98df6c3734e7 100644 (file)
@@ -127,6 +127,7 @@ struct init_fn cachedhcp_init_fn __init_fn ( INIT_NORMAL ) = {
 
 /** Cached DHCPACK startup function */
 struct startup_fn cachedhcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
+       .name = "cachedhcp",
        .startup = cachedhcp_startup,
 };
 
index d160fee0406d349c457692da41c3916a2fa6ddef..f96b23af4d7a26fd0eca5c296a4c7460ead1dd67 100644 (file)
@@ -265,5 +265,6 @@ static void runtime_init ( void ) {
 
 /** Command line and initrd initialisation function */
 struct startup_fn runtime_startup_fn __startup_fn ( STARTUP_NORMAL ) = {
+       .name = "runtime",
        .startup = runtime_init,
 };
index 9c9ca1274ebc4e6a8d61138c68fea1f3aa6eaaac..8983722174891eb4b313753f060ff994368aafc5 100644 (file)
@@ -141,5 +141,6 @@ static void undionly_shutdown ( int booting ) {
 }
 
 struct startup_fn startup_undionly __startup_fn ( STARTUP_LATE ) = {
+       .name = "undionly",
        .shutdown = undionly_shutdown,
 };
index 80c197417145a3013080f3a5acba00b2a5da8119..8f6366d3df20f0f114249d8dc0ef9d65cba61c46 100644 (file)
@@ -300,5 +300,6 @@ static void initrd_startup ( void ) {
 
 /** initrd startup function */
 struct startup_fn startup_initrd __startup_fn ( STARTUP_LATE ) = {
+       .name = "initrd",
        .startup = initrd_startup,
 };
index 08fa6d036d9a1e056cc98933e399b6a29da961a1..52a02fba50ca54d28e91becb14056a66341e1c72 100644 (file)
@@ -547,6 +547,7 @@ static void bios_inject_shutdown ( int booting __unused ) {
 
 /** Keypress injection startup function */
 struct startup_fn bios_inject_startup_fn __startup_fn ( STARTUP_NORMAL ) = {
+       .name = "bios_inject",
        .startup = bios_inject_startup,
        .shutdown = bios_inject_shutdown,
 };
index a3728123cd91b9387a141d91a015580b65672dc3..1a3022c5d7819c83e837847b131eae57d38c3ef1 100644 (file)
@@ -229,6 +229,7 @@ static void unhide_etherboot ( int flags __unused ) {
 
 /** Hide Etherboot startup function */
 struct startup_fn hide_etherboot_startup_fn __startup_fn ( STARTUP_EARLY ) = {
+       .name = "hidemem",
        .startup = hide_etherboot,
        .shutdown = unhide_etherboot,
 };
index 77d7b719be1aef73d6fa30a467c48c36e2261895..efe4eb6877516807b8fba1c900d250bcb18c52d6 100644 (file)
@@ -111,6 +111,7 @@ static void remove_devices ( int booting __unused ) {
 }
 
 struct startup_fn startup_devices __startup_fn ( STARTUP_NORMAL ) = {
+       .name = "devices",
        .startup = probe_devices,
        .shutdown = remove_devices,
 };
index d91e446695ac9ec6e96c509987ec4f445d2608d9..c13fd16679d9059a994d9fbaa365a795d78d6434 100644 (file)
@@ -36,6 +36,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
 /** "startup() has been called" flag */
 static int started = 0;
 
+/** Colour for debug messages */
+#define colour table_start ( INIT_FNS )
+
 /**
  * Initialise iPXE
  *
@@ -69,11 +72,15 @@ void startup ( void ) {
 
        /* Call registered startup functions */
        for_each_table_entry ( startup_fn, STARTUP_FNS ) {
-               if ( startup_fn->startup )
+               if ( startup_fn->startup ) {
+                       DBGC ( colour, "INIT startup %s...\n",
+                              startup_fn->name );
                        startup_fn->startup();
+               }
        }
 
        started = 1;
+       DBGC ( colour, "INIT startup complete\n" );
 }
 
 /**
@@ -96,12 +103,16 @@ void shutdown ( int flags ) {
 
        /* Call registered shutdown functions (in reverse order) */
        for_each_table_entry_reverse ( startup_fn, STARTUP_FNS ) {
-               if ( startup_fn->shutdown )
+               if ( startup_fn->shutdown ) {
+                       DBGC ( colour, "INIT shutdown %s...\n",
+                              startup_fn->name );
                        startup_fn->shutdown ( flags );
+               }
        }
 
        /* Reset console */
        console_reset();
 
        started = 0;
+       DBGC ( colour, "INIT shutdown complete\n" );
 }
index 91c8e4d35d7e148328659bcf499df1326c38d2cd..0a7843a14fcb54d2e3409b3651e76972d55681c8 100644 (file)
@@ -685,6 +685,7 @@ static void shutdown_cache ( int booting __unused ) {
 
 /** Memory allocator shutdown function */
 struct startup_fn heap_startup_fn __startup_fn ( STARTUP_EARLY ) = {
+       .name = "heap",
        .shutdown = shutdown_cache,
 };
 
index dd22f6731689d42955d84ba7f05ab35915cd539b..bef9ccbab232af349fd6139a3922fd0a27ca0722 100644 (file)
@@ -181,5 +181,6 @@ struct init_fn serial_console_init_fn __init_fn ( INIT_CONSOLE ) = {
 
 /** Serial console startup function */
 struct startup_fn serial_startup_fn __startup_fn ( STARTUP_EARLY ) = {
+       .name = "serial",
        .shutdown = serial_shutdown,
 };
index a5a77e3cd5ced9cc7e029ab71f1c409a27f34749..4b45b34745933155f2b9e4469f7a6ca795060951 100644 (file)
@@ -126,6 +126,7 @@ static void rbg_shutdown_fn ( int booting __unused ) {
 
 /** RBG startup table entry */
 struct startup_fn startup_rbg __startup_fn ( STARTUP_NORMAL ) = {
+       .name = "rbg",
        .startup = rbg_startup_fn,
        .shutdown = rbg_shutdown_fn,
 };
index f7b9dcfb7b21ed4f54563f0286b98ad816e27dde..867ff50e8b64e551376c0c8b2dc8a5e3a9986301 100644 (file)
@@ -123,5 +123,6 @@ static void rootcert_init ( void ) {
 
 /** Root certificate initialiser */
 struct startup_fn rootcert_startup_fn __startup_fn ( STARTUP_LATE ) = {
+       .name = "rootcert",
        .startup = rootcert_init,
 };
index 35cbc8de90dafe70e827c7fc39a8dbfbbc8b2142..cd39670707e7af286500a91d92a7cbd6067de673 100644 (file)
@@ -2098,5 +2098,6 @@ static void ehci_shutdown ( int booting ) {
 
 /** Startup/shutdown function */
 struct startup_fn ehci_startup __startup_fn ( STARTUP_LATE ) = {
+       .name = "ehci",
        .shutdown = ehci_shutdown,
 };
index ecf8bf4d5e6e9f65b328d53422ef5d5dd2b0dcf1..e9a7f4c6524af63a5e1f85628ca8b2c0bf4b72f4 100644 (file)
@@ -3363,5 +3363,6 @@ static void xhci_shutdown ( int booting ) {
 
 /** Startup/shutdown function */
 struct startup_fn xhci_startup __startup_fn ( STARTUP_LATE ) = {
+       .name = "xhci",
        .shutdown = xhci_shutdown,
 };
index 58eeb063ec3ae2c87dcdef7a750a2df3bffe6f8a..5f903e3b6b6dbdd80bb7a575f043e7d342ea8820 100644 (file)
@@ -185,6 +185,7 @@ void linux_args_cleanup(int flags __unused)
 }
 
 struct startup_fn startup_linux_args __startup_fn(STARTUP_EARLY) = {
+       .name = "linux_args",
        .startup = linux_args_parse,
        .shutdown = linux_args_cleanup,
 };
index 025cfaf3773582a9e7beadb49081c9d4f544ca64..32927e3a61ff1ca64544322a7d533c5eeabe8821 100644 (file)
@@ -39,6 +39,7 @@ struct init_fn {
  * part of the calls to startup() and shutdown().
  */
 struct startup_fn {
+       const char *name;
        void ( * startup ) ( void );
        void ( * shutdown ) ( int booting );
 };
index 8fe307ceb1fdd8f2cab279257a4caff039dd8812..8f40cb81a88713f50ad0c32ae1d2b5cf0588bb36 100644 (file)
@@ -212,6 +212,7 @@ static void efi_tick_shutdown ( int booting __unused ) {
 
 /** Timer tick startup function */
 struct startup_fn efi_tick_startup_fn __startup_fn ( STARTUP_EARLY ) = {
+       .name = "efi_tick",
        .startup = efi_tick_startup,
        .shutdown = efi_tick_shutdown,
 };
index 5105eaa9499cbd1c2c956f144561da2cae55b18d..5294fca79f83c8eaf53a3cac4f3c1539b9385e74 100644 (file)
@@ -150,6 +150,7 @@ static void linux_console_shutdown(int flags __unused)
 }
 
 struct startup_fn linux_console_startup_fn __startup_fn(STARTUP_EARLY) = {
+       .name = "linux_console",
        .startup = linux_console_startup,
        .shutdown = linux_console_shutdown,
 };
index cb3b84edd8c62fe1a8af58b0fa619b398a9362e5..c445100ad254705a96b7e783d6ed4617847103aa 100644 (file)
@@ -1654,6 +1654,7 @@ static void tcp_shutdown ( int booting __unused ) {
 
 /** TCP shutdown function */
 struct startup_fn tcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
+       .name = "tcp",
        .shutdown = tcp_shutdown,
 };