]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Removed ANNOTATE_HAPPENS_BEFORE/AFTER() usage restrictions.
authorBart Van Assche <bvanassche@acm.org>
Sun, 29 Aug 2010 16:22:04 +0000 (16:22 +0000)
committerBart Van Assche <bvanassche@acm.org>
Sun, 29 Aug 2010 16:22:04 +0000 (16:22 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11307

drd/drd_clientobj.h
drd/drd_hb.c
drd/tests/annotate_hb_err.stderr.exp

index dd1a541aac2a6919e773747d22ad6167b4943a0f..8cda7a44d65162af404cd02f3d89917fdad3aef8 100644 (file)
@@ -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
index 268643afd142c658045d9af393c5714fe8f82b2d..ef5ef7762ff637b057bc8ff1f7cb82769464d84b 100644 (file)
@@ -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);
 
index bf96a09b77d4b07a8c1fe73c55891b69aebdda0e..10c0f6c544552001c117f7a6024b74887816231b 100644 (file)
@@ -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)