// Local variables.
static Bool s_trace_barrier = False;
+static ULong s_barrier_segment_creation_count;
// Function definitions.
}
thread_new_segment(tid);
+ s_barrier_segment_creation_count++;
if (--p->post_waiters_left <= 0)
{
}
return "?";
}
+
+ULong get_barrier_segment_creation_count(void)
+{
+ return s_barrier_segment_creation_count;
+}
const BarrierT barrier_type, const Bool waited);
void barrier_thread_delete(const DrdThreadId threadid);
void barrier_stop_using_mem(const Addr a1, const Addr a2);
+ULong get_barrier_segment_creation_count(void);
#endif /* __DRD_BARRIER_H */
#include "pub_tool_mallocfree.h" // VG_(malloc)(), VG_(free)()
#include "pub_tool_options.h" // command line options
#include "pub_tool_replacemalloc.h"
-#include "pub_tool_replacemalloc.h"
#include "pub_tool_threadstate.h" // VG_(get_running_tid)()
#include "pub_tool_tooliface.h"
sg_get_created_segments_count(),
sg_get_max_alive_segments_count(),
thread_get_discard_ordered_segments_count());
+ VG_(message)(Vg_UserMsg,
+ " (%lld m, %lld rw, %lld s, %lld b)",
+ get_mutex_segment_creation_count(),
+ get_rwlock_segment_creation_count(),
+ get_semaphore_segment_creation_count(),
+ get_barrier_segment_creation_count());
VG_(message)(Vg_UserMsg,
" bitmaps: %lld level 1 / %lld level 2 bitmap refs",
bm_get_bitmap_creation_count(),
static Bool s_trace_mutex;
static ULong s_mutex_lock_count;
+static ULong s_mutex_segment_creation_count;
// Function definitions.
thread_combine_vc2(drd_tid, &p->last_locked_segment->vc);
}
thread_new_segment(drd_tid);
+ s_mutex_segment_creation_count++;
p->owner = drd_tid;
s_mutex_lock_count++;
thread_get_latest_segment(&p->last_locked_segment, drd_tid);
thread_new_segment(drd_tid);
+ s_mutex_segment_creation_count++;
}
}
{
return s_mutex_lock_count;
}
+
+ULong get_mutex_segment_creation_count(void)
+{
+ return s_mutex_segment_creation_count;
+}
int mutex_get_recursion_count(const Addr mutex);
void mutex_thread_delete(const DrdThreadId tid);
ULong get_mutex_lock_count(void);
+ULong get_mutex_segment_creation_count(void);
#endif /* __DRD_MUTEX_H */
// Local functions.
static void rwlock_cleanup(struct rwlock_info* p);
+static ULong s_rwlock_segment_creation_count;
// Local variables.
{
rwlock_combine_other_vc(p, drd_tid, False);
thread_new_segment(drd_tid);
+ s_rwlock_segment_creation_count++;
}
}
tl_assert(q->writer_nesting_count == 1);
rwlock_combine_other_vc(p, drd_tid, True);
thread_new_segment(drd_tid);
+ s_rwlock_segment_creation_count++;
}
/**
thread_get_latest_segment(&q->last_unlock_segment, drd_tid);
q->last_lock_was_writer_lock = False;
thread_new_segment(drd_tid);
+ s_rwlock_segment_creation_count++;
}
}
}
}
}
+
+ULong get_rwlock_segment_creation_count(void)
+{
+ return s_rwlock_segment_creation_count;
+}
void rwlock_post_wrlock(const Addr rwlock, const Bool took_lock);
void rwlock_pre_unlock(const Addr rwlock);
void rwlock_thread_delete(const DrdThreadId tid);
+ULong get_rwlock_segment_creation_count(void);
#endif /* __DRD_RWLOCK_H */
// Local variables.
static Bool s_trace_semaphore;
+static ULong s_semaphore_segment_creation_count;
// Function definitions.
thread_combine_vc2(tid, &p->last_sem_post_segment->vc);
}
thread_new_segment(tid);
+ s_semaphore_segment_creation_count++;
}
/** Called before sem_post(). */
p->last_sem_post_tid = tid;
thread_new_segment(tid);
thread_get_latest_segment(&p->last_sem_post_segment, tid);
+ s_semaphore_segment_creation_count++;
}
}
void semaphore_thread_delete(const DrdThreadId threadid)
{ }
+
+ULong get_semaphore_segment_creation_count(void)
+{
+ return s_semaphore_segment_creation_count;
+}
void semaphore_post_post(const DrdThreadId tid, const Addr semaphore,
const Bool waited);
void semaphore_thread_delete(const DrdThreadId tid);
+ULong get_semaphore_segment_creation_count(void);
#endif /* __DRD_SEMAPHORE_H */