From: Bart Van Assche Date: Sun, 29 Aug 2010 16:22:04 +0000 (+0000) Subject: Removed ANNOTATE_HAPPENS_BEFORE/AFTER() usage restrictions. X-Git-Tag: svn/VALGRIND_3_6_0~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d58c3bb242c503f839817ecbdd7f597fa2079757;p=thirdparty%2Fvalgrind.git Removed ANNOTATE_HAPPENS_BEFORE/AFTER() usage restrictions. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11307 --- diff --git a/drd/drd_clientobj.h b/drd/drd_clientobj.h index dd1a541aac..8cda7a44d6 100644 --- a/drd/drd_clientobj.h +++ b/drd/drd_clientobj.h @@ -95,7 +95,6 @@ struct hb_info void (*delete_thread)(union drd_clientobj*, DrdThreadId); ExeContext* first_observed_at; OSet* oset; // Per-thread order annotation information. - Bool done; // Whether happens-done has already been invoked. }; struct semaphore_info diff --git a/drd/drd_hb.c b/drd/drd_hb.c index 268643afd1..ef5ef7762f 100644 --- a/drd/drd_hb.c +++ b/drd/drd_hb.c @@ -94,7 +94,6 @@ void DRD_(hb_initialize)(struct hb_info* const p, const Addr hb) p->delete_thread = 0; p->oset = VG_(OSetGen_Create)(0, 0, VG_(malloc), "drd.hb", VG_(free)); - p->done = False; } /** @@ -176,20 +175,6 @@ void DRD_(hb_happens_before)(const DrdThreadId tid, Addr const hb) if (!p) return; - if (p->done) - { - GenericErrInfo gei = { - .tid = DRD_(thread_get_running_tid)(), - .addr = hb, - }; - VG_(maybe_record_error)(VG_(get_running_tid)(), - GenericErr, - VG_(get_IP)(VG_(get_running_tid)()), - "happens-before after happens-after", - &gei); - return; - } - /* Allocate the per-thread data structure if necessary. */ q = VG_(OSetGen_Lookup)(p->oset, &word_tid); if (!q) @@ -215,7 +200,7 @@ void DRD_(hb_happens_after)(const DrdThreadId tid, const Addr hb) struct hb_thread_info* q; VectorClock old_vc; - p = DRD_(hb_get)(hb); + p = DRD_(hb_get_or_allocate)(hb); if (DRD_(s_trace_hb)) { @@ -224,20 +209,7 @@ void DRD_(hb_happens_after)(const DrdThreadId tid, const Addr hb) } if (!p) - { - GenericErrInfo gei = { - .tid = DRD_(thread_get_running_tid)(), - .addr = hb, - }; - VG_(maybe_record_error)(VG_(get_running_tid)(), - GenericErr, - VG_(get_IP)(VG_(get_running_tid)()), - "missing happens-before annotation", - &gei); return; - } - - p->done = True; DRD_(thread_new_segment)(tid); diff --git a/drd/tests/annotate_hb_err.stderr.exp b/drd/tests/annotate_hb_err.stderr.exp index bf96a09b77..10c0f6c544 100644 --- a/drd/tests/annotate_hb_err.stderr.exp +++ b/drd/tests/annotate_hb_err.stderr.exp @@ -1,8 +1,4 @@ -missing happens-before annotation - at 0x........: vgDrdCl_annotate_happens_after (drd.h:?) - by 0x........: main (annotate_hb_err.c:?) - wrong type of synchronization object at 0x........: vgDrdCl_annotate_happens_before (drd.h:?) by 0x........: main (annotate_hb_err.c:?) @@ -21,16 +17,9 @@ wrong type of synchronization object at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?) by 0x........: main (annotate_hb_err.c:?) order annotation 0x........ was first observed at: - at 0x........: vgDrdCl_annotate_happens_before (drd.h:?) - by 0x........: main (annotate_hb_err.c:?) - -happens-before after happens-after - at 0x........: vgDrdCl_annotate_happens_before (drd.h:?) - by 0x........: main (annotate_hb_err.c:?) -order annotation 0x........ was first observed at: - at 0x........: vgDrdCl_annotate_happens_before (drd.h:?) + at 0x........: vgDrdCl_annotate_happens_after (drd.h:?) by 0x........: main (annotate_hb_err.c:?) Done. -ERROR SUMMARY: 5 errors from 5 contexts (suppressed: 0 from 0) +ERROR SUMMARY: 3 errors from 3 contexts (suppressed: 0 from 0)