diff options
Diffstat (limited to 'libports/ports.h')
-rw-r--r-- | libports/ports.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libports/ports.h b/libports/ports.h index 9299bc40..a31b894e 100644 --- a/libports/ports.h +++ b/libports/ports.h @@ -76,6 +76,7 @@ struct port_bucket int flags; int count; struct ports_threadpool threadpool; + const char *label; }; /* FLAGS above are the following: */ #define PORT_BUCKET_INHIBITED PORTS_INHIBITED @@ -91,7 +92,10 @@ struct port_class int count; void (*clean_routine) (void *); void (*dropweak_routine) (void *); + error_t (*debug_info) (const void *, char *, size_t); struct ports_msg_id_range *uninhibitable_rpcs; + const char *label; + mach_port_t trace_port; }; /* FLAGS are the following: */ #define PORT_CLASS_INHIBITED PORTS_INHIBITED @@ -160,6 +164,9 @@ extern struct ports_msg_id_range *ports_default_uninhibitable_rpcs; /* Create and return a new bucket. */ struct port_bucket *ports_create_bucket (void); +/* Label BUCKET with LABEL. */ +void ports_label_bucket (struct port_bucket *bucket, const char *label); + /* Create and return a new port class. If nonzero, CLEAN_ROUTINE will be called for each allocated port object in this class when it is being destroyed. If nonzero, DROPWEAK_ROUTINE will be called @@ -169,6 +176,12 @@ struct port_bucket *ports_create_bucket (void); struct port_class *ports_create_class (void (*clean_routine)(void *), void (*dropweak_routine)(void *)); +/* Label CLASS with LABEL. Use DEBUG_INFO to format human-readable + information about a given object belonging to CLASS into an buffer, + or the default formatting function if DEBUG_INFO is NULL. */ +void ports_label_class (struct port_class *class, const char *label, + error_t (*debug_info) (const void *, char *, size_t)); + /* Create and return in RESULT a new port in CLASS and BUCKET; SIZE bytes will be allocated to hold the port structure and whatever private data the user desires. */ @@ -482,5 +495,6 @@ extern int _ports_flags; void _ports_complete_deallocate (struct port_info *); error_t _ports_create_port_internal (struct port_class *, struct port_bucket *, size_t, void *, int); +error_t _ports_trace_message (mach_port_t, const mach_msg_header_t *); #endif |