Index: sys/eventhandler.h =================================================================== RCS file: /home/source/dragonfly/cvs/src/sys/sys/eventhandler.h,v retrieving revision 1.7 diff -u -p -r1.7 eventhandler.h --- sys/eventhandler.h 21 May 2006 03:43:47 -0000 1.7 +++ sys/eventhandler.h 11 Jul 2007 04:31:07 -0000 @@ -43,6 +43,7 @@ struct eventhandler_entry TAILQ_ENTRY(eventhandler_entry) ee_link; int ee_priority; void *ee_arg; + const char *ee_name; }; struct eventhandler_list @@ -55,6 +56,7 @@ struct eventhandler_list }; typedef struct eventhandler_entry *eventhandler_tag; +extern int eventhandler_show_invoked_funcs; /* * Fast handler lists require the eventhandler list be present @@ -85,13 +87,15 @@ do { \ struct eventhandler_entry *_ep = TAILQ_FIRST(&(_el->el_entries)); \ \ while (_ep != NULL) { \ + if (eventhandler_show_invoked_funcs) \ + kprintf("FAST_INVOKE(" #name ") %s\n", _ep->ee_name); \ ((struct eventhandler_entry_ ## name *)_ep)->eh_func(_ep->ee_arg , ## args); \ _ep = TAILQ_NEXT(_ep, ee_link); \ } \ } while (0) #define EVENTHANDLER_FAST_REGISTER(name, func, arg, priority) \ - eventhandler_register(Xeventhandler_list_ ## name, #name, func, arg, priority) + eventhandler_register(Xeventhandler_list_ ## name, #name, #func, func, arg, priority) #define EVENTHANDLER_FAST_DEREGISTER(name, tag) \ eventhandler_deregister(Xeventhandler_list ## name, tag) @@ -121,13 +125,15 @@ do { \ for (_ep = TAILQ_FIRST(&(_el->el_entries)); \ _ep != NULL; \ _ep = TAILQ_NEXT(_ep, ee_link)) { \ + if (eventhandler_show_invoked_funcs) \ + kprintf("INVOKE(" #name ") %s\n", _ep->ee_name); \ ((struct eventhandler_entry_ ## name *)_ep)->eh_func(_ep->ee_arg , ## args); \ } \ } \ } while (0) #define EVENTHANDLER_REGISTER(name, func, arg, priority) \ - eventhandler_register(NULL, #name, func, arg, priority) + eventhandler_register(NULL, #name, #func, func, arg, priority) #define EVENTHANDLER_DEREGISTER(name, tag) \ do { \ @@ -141,6 +147,7 @@ do { \ #ifdef _KERNEL extern eventhandler_tag eventhandler_register(struct eventhandler_list *list, char *name, + const char *fname, void *func, void *arg, int priority); Index: kern/subr_eventhandler.c =================================================================== RCS file: /home/source/dragonfly/cvs/src/sys/kern/subr_eventhandler.c,v retrieving revision 1.5 diff -u -p -r1.5 subr_eventhandler.c --- kern/subr_eventhandler.c 5 Sep 2006 03:48:12 -0000 1.5 +++ kern/subr_eventhandler.c 11 Jul 2007 04:13:07 -0000 @@ -35,6 +35,8 @@ MALLOC_DEFINE(M_EVENTHANDLER, "eventhandler", "Event handler records"); +int eventhandler_show_invoked_funcs = 0; + /* List of 'slow' lists */ static TAILQ_HEAD(, eventhandler_list) eventhandler_lists; static int eventhandler_lists_initted = 0; @@ -50,8 +52,8 @@ struct eventhandler_entry_generic * if all priorities are identical. */ eventhandler_tag -eventhandler_register(struct eventhandler_list *list, char *name, - void *func, void *arg, int priority) +eventhandler_register(struct eventhandler_list *list, char *name, + const char *funcname, void *func, void *arg, int priority) { struct eventhandler_entry_generic *eg; struct eventhandler_entry *ep; @@ -88,6 +90,7 @@ eventhandler_register(struct eventhandle eg->func = func; eg->ee.ee_arg = arg; eg->ee.ee_priority = priority; + eg->ee.ee_name = funcname; /* sort it into the list */ for (ep = TAILQ_FIRST(&list->el_entries);