2 * Copyright 2006 The Android Open Source Project
5 #ifndef _LIBTHREAD_DB__THREAD_DB_H
6 #define _LIBTHREAD_DB__THREAD_DB_H
11 #include <sys/types.h>
13 typedef void *psaddr_t
;
14 typedef pid_t lwpid_t
;
16 #define TD_THR_ANY_USER_FLAGS 0xffffffff
17 #define TD_THR_LOWEST_PRIORITY -20
18 #define TD_SIGNO_MASK NULL
48 * NOTE: There is a max of 32 events
55 /* td_thr_state_e values */
63 typedef int32_t td_err_e
;
64 typedef uint32_t td_event_e
;
65 typedef uint32_t td_notify_e
;
66 typedef uint32_t td_thr_state_e
;
67 typedef pthread_t thread_t
;
72 struct ps_prochandle
*ph
;
84 td_thrhandle_t
const * th_p
;
104 td_thr_state_e ti_state
;
105 thread_t ti_tid
; // pthread's id for the thread
106 int32_t ti_lid
; // the kernel's id for the thread
110 #define td_event_emptyset(set) \
113 #define td_event_fillset(set) \
114 (set)->events = 0xffffffff
116 #define td_event_addset(set, n) \
117 (set)->events |= (1 << n)
120 typedef int td_thr_iter_f(td_thrhandle_t
const *, void *);
123 struct ps_prochandle
;
129 extern td_err_e
td_ta_new(struct ps_prochandle
* proc_handle
, td_thragent_t
** thread_agent
);
131 extern td_err_e
td_ta_delete(td_thragent_t
* ta
);
133 extern td_err_e
td_ta_set_event(td_thragent_t
const * agent
, td_thr_events_t
* event
);
135 extern td_err_e
td_ta_event_addr(td_thragent_t
const * agent
, td_event_e event
, td_notify_t
* notify
);
137 extern td_err_e
td_ta_clear_event(const td_thragent_t
* ta_arg
,
138 td_thr_events_t
* event
);
140 extern td_err_e
td_ta_event_getmsg(td_thragent_t
const * agent
, td_event_msg_t
* event
);
142 extern td_err_e
td_ta_map_lwp2thr(td_thragent_t
const * agent
, lwpid_t lwpid
,
145 extern td_err_e
td_thr_get_info(td_thrhandle_t
const * handle
,
146 td_thrinfo_t
* info
);
148 extern td_err_e
td_thr_event_enable(td_thrhandle_t
const * handle
,
151 extern td_err_e
td_ta_thr_iter(td_thragent_t
const * agent
, td_thr_iter_f
* func
, void * cookie
,
152 td_thr_state_e state
, int32_t prio
, sigset_t
* sigmask
, uint32_t user_flags
);
154 extern char const ** td_symbol_list(void);
156 extern td_err_e
td_thr_tls_get_addr(const td_thrhandle_t
* th
,
157 psaddr_t map_address
, size_t offset
,