Просмотр исходного кода

[process] Include process name in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 6 лет назад
Родитель
Сommit
47849be3a9
1 измененных файлов: 7 добавлений и 2 удалений
  1. 7
    2
      src/include/ipxe/process.h

+ 7
- 2
src/include/ipxe/process.h Просмотреть файл

@@ -29,6 +29,8 @@ struct process {
29 29
 
30 30
 /** A process descriptor */
31 31
 struct process_descriptor {
32
+	/** Process name */
33
+	const char *name;
32 34
 	/** Offset of process within containing object */
33 35
 	size_t offset;
34 36
 	/**
@@ -78,6 +80,7 @@ struct process_descriptor {
78 80
  * @ret desc		Object interface descriptor
79 81
  */
80 82
 #define PROC_DESC( object_type, process, _step ) {			      \
83
+		.name = #_step,						      \
81 84
 		.offset = process_offset ( object_type, process ),	      \
82 85
 		.step = PROC_STEP ( object_type, _step ),		      \
83 86
 		.reschedule = 1,					      \
@@ -92,6 +95,7 @@ struct process_descriptor {
92 95
  * @ret desc		Object interface descriptor
93 96
  */
94 97
 #define PROC_DESC_ONCE( object_type, process, _step ) {			      \
98
+		.name = #_step,						      \
95 99
 		.offset = process_offset ( object_type, process ),	      \
96 100
 		.step = PROC_STEP ( object_type, _step ),		      \
97 101
 		.reschedule = 0,					      \
@@ -106,6 +110,7 @@ struct process_descriptor {
106 110
  * @ret desc		Object interface descriptor
107 111
  */
108 112
 #define PROC_DESC_PURE( _step ) {					      \
113
+		.name = #_step,						      \
109 114
 		.offset = 0,						      \
110 115
 		.step = PROC_STEP ( struct process, _step ),		      \
111 116
 		.reschedule = 1,					      \
@@ -192,7 +197,7 @@ struct process name __permanent_process = {				      \
192 197
 #define PROC_COL( process ) process_object ( process )
193 198
 
194 199
 /** printf() format string for PROC_DBG() */
195
-#define PROC_FMT "%p+%zx"
200
+#define PROC_FMT "%p %s()"
196 201
 
197 202
 /**
198 203
  * printf() arguments for representing a process
@@ -200,6 +205,6 @@ struct process name __permanent_process = {				      \
200 205
  * @v process		Process
201 206
  * @ret args		printf() argument list corresponding to PROC_FMT
202 207
  */
203
-#define PROC_DBG( process ) process_object ( process ), (process)->desc->offset
208
+#define PROC_DBG( process ) process_object ( process ), (process)->desc->name
204 209
 
205 210
 #endif /* _IPXE_PROCESS_H */

Загрузка…
Отмена
Сохранить