summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorMichael Brown2019-01-25 15:53:43 +0100
committerMichael Brown2019-01-25 15:53:43 +0100
commit36a4c85f911c85f5ab183331ff74d125f9a9ed32 (patch)
tree2954c7b32d75848821bd361c40432544e7d4a84a /src/core
parent[util] Add support for EFI ROM images (diff)
downloadipxe-36a4c85f911c85f5ab183331ff74d125f9a9ed32.tar.gz
ipxe-36a4c85f911c85f5ab183331ff74d125f9a9ed32.tar.xz
ipxe-36a4c85f911c85f5ab183331ff74d125f9a9ed32.zip
[init] Show startup and shutdown function names in debug messages
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/device.c1
-rw-r--r--src/core/init.c15
-rw-r--r--src/core/malloc.c1
-rw-r--r--src/core/serial.c1
4 files changed, 16 insertions, 2 deletions
diff --git a/src/core/device.c b/src/core/device.c
index 77d7b719..efe4eb68 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -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,
};
diff --git a/src/core/init.c b/src/core/init.c
index d91e4466..c13fd166 100644
--- a/src/core/init.c
+++ b/src/core/init.c
@@ -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" );
}
diff --git a/src/core/malloc.c b/src/core/malloc.c
index 91c8e4d3..0a7843a1 100644
--- a/src/core/malloc.c
+++ b/src/core/malloc.c
@@ -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,
};
diff --git a/src/core/serial.c b/src/core/serial.c
index dd22f673..bef9ccba 100644
--- a/src/core/serial.c
+++ b/src/core/serial.c
@@ -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,
};