Skip to content

Commit

Permalink
[process] Include process name in debug messages
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Feb 20, 2018
1 parent f672a27 commit 47849be
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/include/ipxe/process.h
Expand Up @@ -29,6 +29,8 @@ struct process {

/** A process descriptor */
struct process_descriptor {
/** Process name */
const char *name;
/** Offset of process within containing object */
size_t offset;
/**
Expand Down Expand Up @@ -78,6 +80,7 @@ struct process_descriptor {
* @ret desc Object interface descriptor
*/
#define PROC_DESC( object_type, process, _step ) { \
.name = #_step, \
.offset = process_offset ( object_type, process ), \
.step = PROC_STEP ( object_type, _step ), \
.reschedule = 1, \
Expand All @@ -92,6 +95,7 @@ struct process_descriptor {
* @ret desc Object interface descriptor
*/
#define PROC_DESC_ONCE( object_type, process, _step ) { \
.name = #_step, \
.offset = process_offset ( object_type, process ), \
.step = PROC_STEP ( object_type, _step ), \
.reschedule = 0, \
Expand All @@ -106,6 +110,7 @@ struct process_descriptor {
* @ret desc Object interface descriptor
*/
#define PROC_DESC_PURE( _step ) { \
.name = #_step, \
.offset = 0, \
.step = PROC_STEP ( struct process, _step ), \
.reschedule = 1, \
Expand Down Expand Up @@ -192,14 +197,14 @@ struct process name __permanent_process = { \
#define PROC_COL( process ) process_object ( process )

/** printf() format string for PROC_DBG() */
#define PROC_FMT "%p+%zx"
#define PROC_FMT "%p %s()"

/**
* printf() arguments for representing a process
*
* @v process Process
* @ret args printf() argument list corresponding to PROC_FMT
*/
#define PROC_DBG( process ) process_object ( process ), (process)->desc->offset
#define PROC_DBG( process ) process_object ( process ), (process)->desc->name

#endif /* _IPXE_PROCESS_H */

0 comments on commit 47849be

Please sign in to comment.