• Home
  • Raw
  • Download

Lines Matching refs:DRD_

61 static Bool DRD_(s_trace_rwlock);
62 static UInt DRD_(s_exclusive_threshold_ms);
63 static UInt DRD_(s_shared_threshold_ms);
64 static ULong DRD_(s_rwlock_segment_creation_count);
69 void DRD_(rwlock_set_trace)(const Bool trace_rwlock) in DRD_() function
72 DRD_(s_trace_rwlock) = trace_rwlock; in DRD_()
75 void DRD_(rwlock_set_exclusive_threshold)(const UInt exclusive_threshold_ms) in DRD_() function
77 DRD_(s_exclusive_threshold_ms) = exclusive_threshold_ms; in DRD_()
80 void DRD_(rwlock_set_shared_threshold)(const UInt shared_threshold_ms) in DRD_() function
82 DRD_(s_shared_threshold_ms) = shared_threshold_ms; in DRD_()
85 static Bool DRD_(rwlock_is_rdlocked)(struct rwlock_info* p) in DRD_() function
97 static Bool DRD_(rwlock_is_wrlocked)(struct rwlock_info* p) in DRD_() function
109 static Bool DRD_(rwlock_is_locked)(struct rwlock_info* p) in DRD_() function
111 return DRD_(rwlock_is_rdlocked)(p) || DRD_(rwlock_is_wrlocked)(p); in DRD_()
114 static Bool DRD_(rwlock_is_rdlocked_by)(struct rwlock_info* p, in DRD_() function
124 static Bool DRD_(rwlock_is_wrlocked_by)(struct rwlock_info* p, in DRD_() function
134 static Bool DRD_(rwlock_is_locked_by)(struct rwlock_info* p, in DRD_() function
137 return (DRD_(rwlock_is_rdlocked_by)(p, tid) in DRD_()
138 || DRD_(rwlock_is_wrlocked_by)(p, tid)); in DRD_()
144 DRD_(lookup_or_insert_node)(OSet* oset, const UWord tid) in DRD_() function
167 static void DRD_(rwlock_combine_other_vc)(struct rwlock_info* const p, in DRD_() function
174 DRD_(vc_copy)(&old_vc, DRD_(thread_get_vc)(tid)); in DRD_()
179 DRD_(vc_combine)(DRD_(thread_get_vc)(tid), in DRD_()
182 DRD_(vc_combine)(DRD_(thread_get_vc)(tid), in DRD_()
186 DRD_(thread_update_conflict_set)(tid, &old_vc); in DRD_()
187 DRD_(vc_cleanup)(&old_vc); in DRD_()
207 RwlockErrInfo REI = { DRD_(thread_get_running_tid)(), p->a1 }; in drd_rwlock_check_type()
222 void DRD_(rwlock_initialize)(struct rwlock_info* const p, const Addr rwlock, in DRD_() function
246 if (DRD_(s_trace_rwlock)) in rwlock_cleanup()
247 DRD_(trace_msg)("[%u] rwlock_destroy 0x%lx", in rwlock_cleanup()
248 DRD_(thread_get_running_tid)(), p->a1); in rwlock_cleanup()
250 if (DRD_(rwlock_is_locked)(p)) in rwlock_cleanup()
252 RwlockErrInfo REI = { DRD_(thread_get_running_tid)(), p->a1 }; in rwlock_cleanup()
263 DRD_(sg_put)(q->latest_wrlocked_segment); in rwlock_cleanup()
264 DRD_(sg_put)(q->latest_rdlocked_segment); in rwlock_cleanup()
272 DRD_(rwlock_get_or_allocate)(const Addr rwlock, const RwLockT rwlock_type) in DRD_() function
277 p = &(DRD_(clientobj_get)(rwlock, ClientRwlock)->rwlock); in DRD_()
284 if (DRD_(clientobj_present)(rwlock, rwlock + 1)) in DRD_()
287 .tid = DRD_(thread_get_running_tid)(), in DRD_()
298 p = &(DRD_(clientobj_add)(rwlock, ClientRwlock)->rwlock); in DRD_()
299 DRD_(rwlock_initialize)(p, rwlock, rwlock_type); in DRD_()
303 static struct rwlock_info* DRD_(rwlock_get)(const Addr rwlock) in DRD_() function
306 return &(DRD_(clientobj_get)(rwlock, ClientRwlock)->rwlock); in DRD_()
310 struct rwlock_info* DRD_(rwlock_pre_init)(const Addr rwlock, in DRD_() function
315 if (DRD_(s_trace_rwlock)) in DRD_()
316 DRD_(trace_msg)("[%u] rwlock_init 0x%lx", in DRD_()
317 DRD_(thread_get_running_tid)(), rwlock); in DRD_()
319 p = DRD_(rwlock_get)(rwlock); in DRD_()
327 RwlockErrInfo REI = { DRD_(thread_get_running_tid)(), p->a1 }; in DRD_()
336 p = DRD_(rwlock_get_or_allocate)(rwlock, rwlock_type); in DRD_()
342 void DRD_(rwlock_post_destroy)(const Addr rwlock, const RwLockT rwlock_type) in DRD_() function
346 p = DRD_(rwlock_get)(rwlock); in DRD_()
350 .tid = DRD_(thread_get_running_tid)(), in DRD_()
363 DRD_(clientobj_remove)(rwlock, ClientRwlock); in DRD_()
372 void DRD_(rwlock_pre_rdlock)(const Addr rwlock, const RwLockT rwlock_type) in DRD_() function
376 if (DRD_(s_trace_rwlock)) in DRD_()
377 DRD_(trace_msg)("[%u] pre_rwlock_rdlock 0x%lx", in DRD_()
378 DRD_(thread_get_running_tid)(), rwlock); in DRD_()
380 p = DRD_(rwlock_get_or_allocate)(rwlock, rwlock_type); in DRD_()
383 if (DRD_(rwlock_is_wrlocked_by)(p, DRD_(thread_get_running_tid)())) { in DRD_()
384 RwlockErrInfo REI = { DRD_(thread_get_running_tid)(), p->a1 }; in DRD_()
398 void DRD_(rwlock_post_rdlock)(const Addr rwlock, const RwLockT rwlock_type, in DRD_() function
401 const DrdThreadId drd_tid = DRD_(thread_get_running_tid)(); in DRD_()
405 if (DRD_(s_trace_rwlock)) in DRD_()
406 DRD_(trace_msg)("[%u] post_rwlock_rdlock 0x%lx", drd_tid, rwlock); in DRD_()
408 p = DRD_(rwlock_get)(rwlock); in DRD_()
413 tl_assert(! DRD_(rwlock_is_wrlocked)(p)); in DRD_()
415 q = DRD_(lookup_or_insert_node)(p->thread_info, drd_tid); in DRD_()
418 DRD_(thread_new_segment)(drd_tid); in DRD_()
419 DRD_(s_rwlock_segment_creation_count)++; in DRD_()
420 DRD_(rwlock_combine_other_vc)(p, drd_tid, False); in DRD_()
433 void DRD_(rwlock_pre_wrlock)(const Addr rwlock, const RwLockT rwlock_type) in DRD_() function
437 p = DRD_(rwlock_get)(rwlock); in DRD_()
439 if (DRD_(s_trace_rwlock)) in DRD_()
440 DRD_(trace_msg)("[%u] pre_rwlock_wrlock 0x%lx", in DRD_()
441 DRD_(thread_get_running_tid)(), rwlock); in DRD_()
444 p = DRD_(rwlock_get_or_allocate)(rwlock, rwlock_type); in DRD_()
448 if (DRD_(rwlock_is_wrlocked_by)(p, DRD_(thread_get_running_tid)())) in DRD_()
450 RwlockErrInfo REI = { DRD_(thread_get_running_tid)(), p->a1 }; in DRD_()
464 void DRD_(rwlock_post_wrlock)(const Addr rwlock, const RwLockT rwlock_type, in DRD_() function
467 const DrdThreadId drd_tid = DRD_(thread_get_running_tid)(); in DRD_()
471 p = DRD_(rwlock_get)(rwlock); in DRD_()
473 if (DRD_(s_trace_rwlock)) in DRD_()
474 DRD_(trace_msg)("[%u] post_rwlock_wrlock 0x%lx", drd_tid, rwlock); in DRD_()
479 q = DRD_(lookup_or_insert_node)(p->thread_info, in DRD_()
480 DRD_(thread_get_running_tid)()); in DRD_()
484 DRD_(thread_new_segment)(drd_tid); in DRD_()
485 DRD_(s_rwlock_segment_creation_count)++; in DRD_()
486 DRD_(rwlock_combine_other_vc)(p, drd_tid, True); in DRD_()
501 void DRD_(rwlock_pre_unlock)(const Addr rwlock, const RwLockT rwlock_type) in DRD_() function
503 const DrdThreadId drd_tid = DRD_(thread_get_running_tid)(); in DRD_()
508 if (DRD_(s_trace_rwlock)) in DRD_()
509 DRD_(trace_msg)("[%u] rwlock_unlock 0x%lx", drd_tid, rwlock); in DRD_()
511 p = DRD_(rwlock_get)(rwlock); in DRD_()
515 .tid = DRD_(thread_get_running_tid)(), in DRD_()
528 if (! DRD_(rwlock_is_locked_by)(p, drd_tid)) in DRD_()
530 RwlockErrInfo REI = { DRD_(thread_get_running_tid)(), p->a1 }; in DRD_()
538 q = DRD_(lookup_or_insert_node)(p->thread_info, drd_tid); in DRD_()
543 if (q->reader_nesting_count == 0 && DRD_(s_shared_threshold_ms) > 0) in DRD_()
546 if (held > DRD_(s_shared_threshold_ms)) in DRD_()
549 = { DRD_(thread_get_running_tid)(), in DRD_()
550 rwlock, p->acquired_at, held, DRD_(s_shared_threshold_ms) }; in DRD_()
565 DRD_(thread_get_latest_segment)(&q->latest_rdlocked_segment, drd_tid); in DRD_()
566 DRD_(thread_new_segment)(drd_tid); in DRD_()
567 DRD_(s_rwlock_segment_creation_count)++; in DRD_()
573 if (q->writer_nesting_count == 0 && DRD_(s_exclusive_threshold_ms) > 0) in DRD_()
576 if (held > DRD_(s_exclusive_threshold_ms)) in DRD_()
579 = { DRD_(thread_get_running_tid)(), in DRD_()
581 DRD_(s_exclusive_threshold_ms) }; in DRD_()
596 DRD_(thread_get_latest_segment)(&q->latest_wrlocked_segment, drd_tid); in DRD_()
597 DRD_(thread_new_segment)(drd_tid); in DRD_()
598 DRD_(s_rwlock_segment_creation_count)++; in DRD_()
613 if (DRD_(rwlock_is_locked_by)(p, tid)) in rwlock_delete_thread()
615 RwlockErrInfo REI = { DRD_(thread_get_running_tid)(), p->a1 }; in rwlock_delete_thread()
621 q = DRD_(lookup_or_insert_node)(p->thread_info, tid); in rwlock_delete_thread()
627 ULong DRD_(get_rwlock_segment_creation_count)(void) in DRD_() function
629 return DRD_(s_rwlock_segment_creation_count); in DRD_()