Browse Source

[init] Show startup and shutdown function names in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 5 years ago
parent
commit
36a4c85f91

+ 1
- 0
src/arch/x86/core/cachedhcp.c View File

127
 
127
 
128
 /** Cached DHCPACK startup function */
128
 /** Cached DHCPACK startup function */
129
 struct startup_fn cachedhcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
129
 struct startup_fn cachedhcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
130
+	.name = "cachedhcp",
130
 	.startup = cachedhcp_startup,
131
 	.startup = cachedhcp_startup,
131
 };
132
 };
132
 
133
 

+ 1
- 0
src/arch/x86/core/runtime.c View File

265
 
265
 
266
 /** Command line and initrd initialisation function */
266
 /** Command line and initrd initialisation function */
267
 struct startup_fn runtime_startup_fn __startup_fn ( STARTUP_NORMAL ) = {
267
 struct startup_fn runtime_startup_fn __startup_fn ( STARTUP_NORMAL ) = {
268
+	.name = "runtime",
268
 	.startup = runtime_init,
269
 	.startup = runtime_init,
269
 };
270
 };

+ 1
- 0
src/arch/x86/drivers/net/undionly.c View File

141
 }
141
 }
142
 
142
 
143
 struct startup_fn startup_undionly __startup_fn ( STARTUP_LATE ) = {
143
 struct startup_fn startup_undionly __startup_fn ( STARTUP_LATE ) = {
144
+	.name = "undionly",
144
 	.shutdown = undionly_shutdown,
145
 	.shutdown = undionly_shutdown,
145
 };
146
 };

+ 1
- 0
src/arch/x86/image/initrd.c View File

300
 
300
 
301
 /** initrd startup function */
301
 /** initrd startup function */
302
 struct startup_fn startup_initrd __startup_fn ( STARTUP_LATE ) = {
302
 struct startup_fn startup_initrd __startup_fn ( STARTUP_LATE ) = {
303
+	.name = "initrd",
303
 	.startup = initrd_startup,
304
 	.startup = initrd_startup,
304
 };
305
 };

+ 1
- 0
src/arch/x86/interface/pcbios/bios_console.c View File

547
 
547
 
548
 /** Keypress injection startup function */
548
 /** Keypress injection startup function */
549
 struct startup_fn bios_inject_startup_fn __startup_fn ( STARTUP_NORMAL ) = {
549
 struct startup_fn bios_inject_startup_fn __startup_fn ( STARTUP_NORMAL ) = {
550
+	.name = "bios_inject",
550
 	.startup = bios_inject_startup,
551
 	.startup = bios_inject_startup,
551
 	.shutdown = bios_inject_shutdown,
552
 	.shutdown = bios_inject_shutdown,
552
 };
553
 };

+ 1
- 0
src/arch/x86/interface/pcbios/hidemem.c View File

229
 
229
 
230
 /** Hide Etherboot startup function */
230
 /** Hide Etherboot startup function */
231
 struct startup_fn hide_etherboot_startup_fn __startup_fn ( STARTUP_EARLY ) = {
231
 struct startup_fn hide_etherboot_startup_fn __startup_fn ( STARTUP_EARLY ) = {
232
+	.name = "hidemem",
232
 	.startup = hide_etherboot,
233
 	.startup = hide_etherboot,
233
 	.shutdown = unhide_etherboot,
234
 	.shutdown = unhide_etherboot,
234
 };
235
 };

+ 1
- 0
src/core/device.c View File

111
 }
111
 }
112
 
112
 
113
 struct startup_fn startup_devices __startup_fn ( STARTUP_NORMAL ) = {
113
 struct startup_fn startup_devices __startup_fn ( STARTUP_NORMAL ) = {
114
+	.name = "devices",
114
 	.startup = probe_devices,
115
 	.startup = probe_devices,
115
 	.shutdown = remove_devices,
116
 	.shutdown = remove_devices,
116
 };
117
 };

+ 13
- 2
src/core/init.c View File

36
 /** "startup() has been called" flag */
36
 /** "startup() has been called" flag */
37
 static int started = 0;
37
 static int started = 0;
38
 
38
 
39
+/** Colour for debug messages */
40
+#define colour table_start ( INIT_FNS )
41
+
39
 /**
42
 /**
40
  * Initialise iPXE
43
  * Initialise iPXE
41
  *
44
  *
69
 
72
 
70
 	/* Call registered startup functions */
73
 	/* Call registered startup functions */
71
 	for_each_table_entry ( startup_fn, STARTUP_FNS ) {
74
 	for_each_table_entry ( startup_fn, STARTUP_FNS ) {
72
-		if ( startup_fn->startup )
75
+		if ( startup_fn->startup ) {
76
+			DBGC ( colour, "INIT startup %s...\n",
77
+			       startup_fn->name );
73
 			startup_fn->startup();
78
 			startup_fn->startup();
79
+		}
74
 	}
80
 	}
75
 
81
 
76
 	started = 1;
82
 	started = 1;
83
+	DBGC ( colour, "INIT startup complete\n" );
77
 }
84
 }
78
 
85
 
79
 /**
86
 /**
96
 
103
 
97
 	/* Call registered shutdown functions (in reverse order) */
104
 	/* Call registered shutdown functions (in reverse order) */
98
 	for_each_table_entry_reverse ( startup_fn, STARTUP_FNS ) {
105
 	for_each_table_entry_reverse ( startup_fn, STARTUP_FNS ) {
99
-		if ( startup_fn->shutdown )
106
+		if ( startup_fn->shutdown ) {
107
+			DBGC ( colour, "INIT shutdown %s...\n",
108
+			       startup_fn->name );
100
 			startup_fn->shutdown ( flags );
109
 			startup_fn->shutdown ( flags );
110
+		}
101
 	}
111
 	}
102
 
112
 
103
 	/* Reset console */
113
 	/* Reset console */
104
 	console_reset();
114
 	console_reset();
105
 
115
 
106
 	started = 0;
116
 	started = 0;
117
+	DBGC ( colour, "INIT shutdown complete\n" );
107
 }
118
 }

+ 1
- 0
src/core/malloc.c View File

685
 
685
 
686
 /** Memory allocator shutdown function */
686
 /** Memory allocator shutdown function */
687
 struct startup_fn heap_startup_fn __startup_fn ( STARTUP_EARLY ) = {
687
 struct startup_fn heap_startup_fn __startup_fn ( STARTUP_EARLY ) = {
688
+	.name = "heap",
688
 	.shutdown = shutdown_cache,
689
 	.shutdown = shutdown_cache,
689
 };
690
 };
690
 
691
 

+ 1
- 0
src/core/serial.c View File

181
 
181
 
182
 /** Serial console startup function */
182
 /** Serial console startup function */
183
 struct startup_fn serial_startup_fn __startup_fn ( STARTUP_EARLY ) = {
183
 struct startup_fn serial_startup_fn __startup_fn ( STARTUP_EARLY ) = {
184
+	.name = "serial",
184
 	.shutdown = serial_shutdown,
185
 	.shutdown = serial_shutdown,
185
 };
186
 };

+ 1
- 0
src/crypto/rbg.c View File

126
 
126
 
127
 /** RBG startup table entry */
127
 /** RBG startup table entry */
128
 struct startup_fn startup_rbg __startup_fn ( STARTUP_NORMAL ) = {
128
 struct startup_fn startup_rbg __startup_fn ( STARTUP_NORMAL ) = {
129
+	.name = "rbg",
129
 	.startup = rbg_startup_fn,
130
 	.startup = rbg_startup_fn,
130
 	.shutdown = rbg_shutdown_fn,
131
 	.shutdown = rbg_shutdown_fn,
131
 };
132
 };

+ 1
- 0
src/crypto/rootcert.c View File

123
 
123
 
124
 /** Root certificate initialiser */
124
 /** Root certificate initialiser */
125
 struct startup_fn rootcert_startup_fn __startup_fn ( STARTUP_LATE ) = {
125
 struct startup_fn rootcert_startup_fn __startup_fn ( STARTUP_LATE ) = {
126
+	.name = "rootcert",
126
 	.startup = rootcert_init,
127
 	.startup = rootcert_init,
127
 };
128
 };

+ 1
- 0
src/drivers/usb/ehci.c View File

2098
 
2098
 
2099
 /** Startup/shutdown function */
2099
 /** Startup/shutdown function */
2100
 struct startup_fn ehci_startup __startup_fn ( STARTUP_LATE ) = {
2100
 struct startup_fn ehci_startup __startup_fn ( STARTUP_LATE ) = {
2101
+	.name = "ehci",
2101
 	.shutdown = ehci_shutdown,
2102
 	.shutdown = ehci_shutdown,
2102
 };
2103
 };

+ 1
- 0
src/drivers/usb/xhci.c View File

3363
 
3363
 
3364
 /** Startup/shutdown function */
3364
 /** Startup/shutdown function */
3365
 struct startup_fn xhci_startup __startup_fn ( STARTUP_LATE ) = {
3365
 struct startup_fn xhci_startup __startup_fn ( STARTUP_LATE ) = {
3366
+	.name = "xhci",
3366
 	.shutdown = xhci_shutdown,
3367
 	.shutdown = xhci_shutdown,
3367
 };
3368
 };

+ 1
- 0
src/hci/linux_args.c View File

185
 }
185
 }
186
 
186
 
187
 struct startup_fn startup_linux_args __startup_fn(STARTUP_EARLY) = {
187
 struct startup_fn startup_linux_args __startup_fn(STARTUP_EARLY) = {
188
+	.name = "linux_args",
188
 	.startup = linux_args_parse,
189
 	.startup = linux_args_parse,
189
 	.shutdown = linux_args_cleanup,
190
 	.shutdown = linux_args_cleanup,
190
 };
191
 };

+ 1
- 0
src/include/ipxe/init.h View File

39
  * part of the calls to startup() and shutdown().
39
  * part of the calls to startup() and shutdown().
40
  */
40
  */
41
 struct startup_fn {
41
 struct startup_fn {
42
+	const char *name;
42
 	void ( * startup ) ( void );
43
 	void ( * startup ) ( void );
43
 	void ( * shutdown ) ( int booting );
44
 	void ( * shutdown ) ( int booting );
44
 };
45
 };

+ 1
- 0
src/interface/efi/efi_timer.c View File

212
 
212
 
213
 /** Timer tick startup function */
213
 /** Timer tick startup function */
214
 struct startup_fn efi_tick_startup_fn __startup_fn ( STARTUP_EARLY ) = {
214
 struct startup_fn efi_tick_startup_fn __startup_fn ( STARTUP_EARLY ) = {
215
+	.name = "efi_tick",
215
 	.startup = efi_tick_startup,
216
 	.startup = efi_tick_startup,
216
 	.shutdown = efi_tick_shutdown,
217
 	.shutdown = efi_tick_shutdown,
217
 };
218
 };

+ 1
- 0
src/interface/linux/linux_console.c View File

150
 }
150
 }
151
 
151
 
152
 struct startup_fn linux_console_startup_fn __startup_fn(STARTUP_EARLY) = {
152
 struct startup_fn linux_console_startup_fn __startup_fn(STARTUP_EARLY) = {
153
+	.name = "linux_console",
153
 	.startup = linux_console_startup,
154
 	.startup = linux_console_startup,
154
 	.shutdown = linux_console_shutdown,
155
 	.shutdown = linux_console_shutdown,
155
 };
156
 };

+ 1
- 0
src/net/tcp.c View File

1654
 
1654
 
1655
 /** TCP shutdown function */
1655
 /** TCP shutdown function */
1656
 struct startup_fn tcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
1656
 struct startup_fn tcp_startup_fn __startup_fn ( STARTUP_LATE ) = {
1657
+	.name = "tcp",
1657
 	.shutdown = tcp_shutdown,
1658
 	.shutdown = tcp_shutdown,
1658
 };
1659
 };
1659
 
1660
 

Loading…
Cancel
Save