Module: xenomai-forge
Branch: next
Commit: 4da1cc38cb4e5d19e1526aab2cc3dd5b747b789b
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=4da1cc38cb4e5d19e1526aab2cc3dd5b747b789b

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Apr 30 10:55:46 2014 +0200

copperplate/traceobj: suppress sequence mismatch report over Valgrind

The normal scheduling order of an application is significantly
affected by running over Valgrind. For this reason, reports of
execution sequence mismatches are meaningless in such context.

---

 lib/copperplate/traceobj.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/lib/copperplate/traceobj.c b/lib/copperplate/traceobj.c
index 6bec5dc..1a01cd0 100644
--- a/lib/copperplate/traceobj.c
+++ b/lib/copperplate/traceobj.c
@@ -23,6 +23,18 @@
 #include "copperplate/heapobj.h"
 #include "copperplate/init.h"
 #include "internal.h"
+#ifdef CONFIG_XENO_VALGRIND_API
+#include <valgrind/valgrind.h>
+static inline int valgrind_detected(void)
+{
+       return RUNNING_ON_VALGRIND;
+}
+#else
+static inline int valgrind_detected(void)
+{
+       return 0;
+}
+#endif
 
 struct tracemark {
        const char *file;
@@ -110,11 +122,16 @@ void traceobj_verify(struct traceobj *trobj, int tseq[], 
int nr_seq)
                if (trobj->marks[mark].mark != tseq[mark])
                        goto fail;
        }
-
+out:
        read_unlock_safe(&trobj->lock, state);
        return;
 
 fail:
+       if (valgrind_detected()) {
+               warning("valgrind detected: ignoring sequence mismatch");
+               goto out;
+       }
+               
        warning("mismatching execution sequence detected");
        compare_marks(trobj, tseq, nr_seq);
        read_unlock_safe(&trobj->lock, state);


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to