--- src/lib/libthread_xu/thread/thr_private.h 2005/05/07 07:50:51 1.5 +++ src/lib/libthread_xu/thread/thr_private.h 2005/05/07 09:29:46 1.6 @@ -57,6 +57,7 @@ #include "pthread_md.h" #include "thr_umtx.h" +#include "thread_db.h" /* * Evaluate the storage class specifier. @@ -502,6 +503,15 @@ struct pthread { /* Cleanup handlers Link List */ struct pthread_cleanup *cleanup; + + /* Enable event reporting */ + int report_events; + + /* Event mask */ + td_thr_events_t event_mask; + + /* Event */ + td_event_msg_t event_buf; }; #define THR_UMTX_TRYLOCK(thrd, lck) \ @@ -584,6 +594,10 @@ do { \ #define THR_IN_SYNCQ(thrd) (((thrd)->sflags & THR_FLAGS_IN_SYNCQ) != 0) +#define SHOULD_REPORT_EVENT(curthr, e) \ + (curthr->report_events && \ + (((curthr)->event_mask | _thread_event_mask ) & e) != 0) + extern int __isthreaded; /* @@ -592,9 +606,12 @@ extern int __isthreaded; SCLASS void *_usrstack SCLASS_PRESET(NULL); SCLASS struct pthread *_thr_initial SCLASS_PRESET(NULL); +SCLASS int _thread_scope_system SCLASS_PRESET(0); + /* For debugger */ SCLASS int _libthread_xu_debug SCLASS_PRESET(0); -SCLASS int _thread_scope_system SCLASS_PRESET(0); +SCLASS int _thread_event_mask SCLASS_PRESET(0); +SCLASS struct pthread *_thread_last_event; /* List of all threads: */ SCLASS TAILQ_HEAD(, pthread) _thread_list @@ -654,6 +671,7 @@ SCLASS umtx_t _cond_static_lock; SCLASS umtx_t _rwlock_static_lock; SCLASS umtx_t _keytable_lock; SCLASS umtx_t _thr_list_lock; +SCLASS umtx_t _thr_event_lock; /* Undefine the storage class and preset specifiers: */ #undef SCLASS @@ -730,6 +748,11 @@ void _thr_unlink(struct pthread *curthre void _thr_suspend_check(struct pthread *curthread); void _thr_assert_lock_level() __dead2; int _thr_get_tid(void); +void _thr_report_creation(struct pthread *curthread, + struct pthread *newthread); +void _thr_report_death(struct pthread *curthread); +void _thread_bp_create(void); +void _thread_bp_death(void); /* #include */ #ifdef _SYS_AIO_H_