Go to the documentation of this file.
6 #ifndef ABTI_TOOL_H_INCLUDED
7 #define ABTI_TOOL_H_INCLUDED
12 #ifndef ABT_CONFIG_DISABLE_TOOL_INTERFACE
16 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
32 #ifndef ABT_CONFIG_DISABLE_ERROR_CHECK
45 #define ABTI_TOOL_EVENT_TAG_SIZE 20
46 #define ABTI_TOOL_EVENT_TAG_MASK \
47 ((((uint64_t)1 << (uint64_t)ABTI_TOOL_EVENT_TAG_SIZE) - 1) \
48 << (uint64_t)(64 - 1 - ABTI_TOOL_EVENT_TAG_SIZE))
49 #define ABTI_TOOL_EVENT_TAG_INC \
50 ((uint64_t)1 << (uint64_t)(64 - 1 - ABTI_TOOL_EVENT_TAG_SIZE))
51 #define ABTI_TOOL_EVENT_TAG_DIRTY_BIT ((uint64_t)1 << (uint64_t)(64 - 1))
56 uint64_t event_mask,
void *user_arg)
103 #ifdef ABT_CONFIG_DISABLE_TOOL_INTERFACE
110 if (current_mask & event_code) {
134 cb_func_thread(h_thread, h_xstream, event_code, h_tctx,
148 p_caller, p_pool, NULL,
157 p_caller, NULL, NULL,
166 p_caller, NULL, NULL,
176 p_caller, p_pool, NULL,
220 sync_event_type, p_sync);
227 sync_event_type, p_sync);
239 sync_event_type, p_sync);
247 &p_ythread->
thread, p_caller,
252 #ifndef ABT_CONFIG_DISABLE_TOOL_INTERFACE
253 #define ABTI_USE_TOOL_INTERFACE 1
255 #define ABTI_USE_TOOL_INTERFACE 0
258 #define ABTI_tool_event_thread_create(p_local, p_thread, p_caller, p_pool) \
260 if (ABTI_USE_TOOL_INTERFACE) { \
261 ABTI_tool_event_thread_create_impl(p_local, p_thread, p_caller, \
266 #define ABTI_tool_event_thread_join(p_local, p_thread, p_caller) \
268 if (ABTI_USE_TOOL_INTERFACE) { \
269 ABTI_tool_event_thread_join_impl(p_local, p_thread, p_caller); \
273 #define ABTI_tool_event_thread_free(p_local, p_thread, p_caller) \
275 if (ABTI_USE_TOOL_INTERFACE) { \
276 ABTI_tool_event_thread_free_impl(p_local, p_thread, p_caller); \
280 #define ABTI_tool_event_thread_revive(p_local, p_thread, p_caller, p_pool) \
282 if (ABTI_USE_TOOL_INTERFACE) { \
283 ABTI_tool_event_thread_revive_impl(p_local, p_thread, p_caller, \
288 #define ABTI_tool_event_thread_run(p_local_xstream, p_thread, p_prev, \
291 if (ABTI_USE_TOOL_INTERFACE) { \
292 ABTI_tool_event_thread_run_impl(p_local_xstream, p_thread, p_prev, \
297 #define ABTI_tool_event_thread_finish(p_local_xstream, p_thread, p_parent) \
299 if (ABTI_USE_TOOL_INTERFACE) { \
300 ABTI_tool_event_thread_finish_impl(p_local_xstream, p_thread, \
305 #define ABTI_tool_event_thread_cancel(p_local_xstream, p_thread) \
307 if (ABTI_USE_TOOL_INTERFACE) { \
308 ABTI_tool_event_thread_cancel_impl(p_local_xstream, p_thread); \
312 #define ABTI_tool_event_ythread_yield(p_local_xstream, p_ythread, p_parent, \
313 sync_event_type, p_sync) \
315 if (ABTI_USE_TOOL_INTERFACE) { \
316 ABTI_tool_event_ythread_yield_impl(p_local_xstream, p_ythread, \
317 p_parent, sync_event_type, \
322 #define ABTI_tool_event_ythread_suspend(p_local_xstream, p_ythread, p_parent, \
323 sync_event_type, p_sync) \
325 if (ABTI_USE_TOOL_INTERFACE) { \
326 ABTI_tool_event_ythread_suspend_impl(p_local_xstream, p_ythread, \
327 p_parent, sync_event_type, \
332 #define ABTI_tool_event_ythread_resume(p_local, p_ythread, p_caller) \
334 if (ABTI_USE_TOOL_INTERFACE) { \
335 ABTI_tool_event_ythread_resume_impl(p_local, p_ythread, p_caller); \
ABTD_spinlock tool_writer_lock
struct ABT_thread_opaque * ABT_task
Work unit handle type.
struct ABT_thread_opaque * ABT_thread
Work unit handle type.
ABTI_global * gp_ABTI_global
ABTD_atomic_uint32 request
ABT_tool_thread_callback_fn tool_thread_cb_f
static uint64_t ABTD_atomic_acquire_load_uint64(const ABTD_atomic_uint64 *ptr)
static ABT_xstream ABTI_xstream_get_handle(ABTI_xstream *p_xstream)
static void ABTD_atomic_release_store_uint64(ABTD_atomic_uint64 *ptr, uint64_t val)
struct ABT_xstream_opaque * ABT_xstream
Execution stream handle type.
static void ABTD_spinlock_acquire(ABTD_spinlock *p_lock)
ABT_sync_event_type sync_event_type
static uint32_t ABTD_atomic_relaxed_load_uint32(const ABTD_atomic_uint32 *ptr)
void * tool_thread_user_arg
static ABTI_xstream * ABTI_local_get_xstream_or_null(ABTI_local *p_local)
static ABTI_local * ABTI_xstream_get_local(ABTI_xstream *p_xstream)
#define ABTU_unlikely(cond)
ABTD_atomic_uint64 tool_thread_event_mask_tagged
static void ABTD_spinlock_release(ABTD_spinlock *p_lock)
#define ABT_TOOL_CONTEXT_NULL
struct ABTI_local ABTI_local
#define ABTI_THREAD_REQ_BLOCK
void(* ABT_tool_thread_callback_fn)(ABT_thread, ABT_xstream, uint64_t event, ABT_tool_context context, void *user_arg)