vc = DRD_(vc_aprint)(DRD_(thread_get_vc)(DRD_(thread_get_running_tid)()));
if (access_type == eStore && size <= sizeof(HWord)) {
- DRD_(trace_msg_w_bt)("store 0x%lx size %ld val 0x%lx (thread %d /"
- " vc %s)", addr, size, stored_value,
+ DRD_(trace_msg_w_bt)("store 0x%lx size %ld val %ld/0x%lx (thread %d /"
+ " vc %s)", addr, size, stored_value, stored_value,
DRD_(thread_get_running_tid)(), vc);
} else {
DRD_(trace_msg_w_bt)("%s 0x%lx size %ld (thread %d / vc %s)",
check_PROGRAMS += \
annotate_barrier \
annotate_rwlock \
+ annotate_trace_memory \
atomic_var \
circular_buffer
endif
--- /dev/null
+#include <stdio.h>
+#include <inttypes.h>
+#include "../../drd/drd.h"
+
+volatile float f;
+volatile double d;
+volatile int8_t i8;
+volatile int16_t i16;
+volatile int32_t i32;
+volatile int64_t i64;
+
+int main(int argc, char** argv)
+{
+ DRD_TRACE_VAR(f);
+ DRD_TRACE_VAR(d);
+ DRD_TRACE_VAR(i8);
+ DRD_TRACE_VAR(i16);
+ DRD_TRACE_VAR(i32);
+ DRD_TRACE_VAR(i64);
+
+ fprintf(stderr, "float\n");
+ f = 1;
+ f += 2;
+ fprintf(stderr, "double\n");
+ d = 3;
+ d += 4;
+ fprintf(stderr, "uint8_t\n");
+ i8 = 5;
+ i8 += 6;
+ fprintf(stderr, "uint16_t\n");
+ i16 = 7;
+ i16++;
+ fprintf(stderr, "uint32_t\n");
+ i32 = 8;
+ __sync_add_and_fetch(&i32, 1);
+ fprintf(stderr, "uint64_t\n");
+ i64 = 9;
+ __sync_add_and_fetch(&i64, 0x12345678ULL);
+
+ DRD_STOP_TRACE_VAR(f);
+ DRD_STOP_TRACE_VAR(d);
+ DRD_STOP_TRACE_VAR(i8);
+ DRD_STOP_TRACE_VAR(i16);
+ DRD_STOP_TRACE_VAR(i32);
+ DRD_STOP_TRACE_VAR(i64);
+
+ fprintf(stderr, "Done.\n");
+ return 0;
+}
-FLAGS [phb=1, fm=0]
-test01: positive
-store 0x........ size 4 val 0x........ (thread x / vc ...)
- at 0x........: test01::Worker() (tsan_unittest.cpp:?)
- by 0x........: MyThread::ThreadBody(MyThread*) (tsan_thread_wrappers_pthread.h:?)
-store 0x........ size 4 val 0x........ (thread x / vc ...)
- at 0x........: test01::Parent() (tsan_unittest.cpp:?)
- by 0x........: test01::Run() (tsan_unittest.cpp:?)
-Conflicting store by thread x at 0x........ size 4
- at 0x........: test01::Parent() (tsan_unittest.cpp:?)
- by 0x........: test01::Run() (tsan_unittest.cpp:?)
-Allocation context: BSS section of tsan_unittest
-
+float
+store 0x........ size 4 val 1065353216/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+load 0x........ size 4 (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+store 0x........ size 4 val 1077936128/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+double
+store 0x........ size 8 val 4613937818241073152/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+load 0x........ size 8 (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+store 0x........ size 8 val 4619567317775286272/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+uint8_t
+store 0x........ size 1 val 5/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+load 0x........ size 1 (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+store 0x........ size 1 val 11/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+uint16_t
+store 0x........ size 2 val 7/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+load 0x........ size 2 (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+store 0x........ size 2 val 8/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+uint32_t
+store 0x........ size 4 val 8/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
load 0x........ size 4 (thread x / vc ...)
- at 0x........: test01::Run() (tsan_unittest.cpp:?)
- by 0x........: Test::Run() (tsan_unittest.cpp:?)
- GLOB=2
+ at 0x........: main (annotate_trace_memory.c:?)
+store 0x........ size 4 val 9/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+uint64_t
+store 0x........ size 8 val 9/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+load 0x........ size 8 (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+store 0x........ size 8 val 305419905/0x........ (thread x / vc ...)
+ at 0x........: main (annotate_trace_memory.c:?)
+Done.
-ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
+ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
-prereq: test -e tsan_unittest && ./supported_libpthread
+prereq: test -e annotate_trace_memory && ./supported_libpthread
vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no --num-callers=2
-prog: tsan_unittest
-args: 1
+prog: annotate_trace_memory
stderr_filter: filter_stderr_and_thread_no
<args>
<vargv>...</vargv>
<argv>
- <exe>./tsan_unittest</exe>
- <arg>1</arg>
+ <exe>./annotate_trace_memory</exe>
</argv>
</args>
<time>...</time>
</status>
-FLAGS [phb=1, fm=0]
-test01: positive
- <trace><text>store 0x........ size 4 val 0x........ (thread x / vc ...)</text>
+float
+ <trace><text>store 0x........ size 4 val 1065353216/0x........ (thread x / vc ...)</text>
<stack>
<frame>
<ip>0x........</ip>
<obj>...</obj>
- <fn>test01::Worker()</fn>
+ <fn>main</fn>
<dir>...</dir>
- <file>tsan_unittest.cpp</file>
+ <file>annotate_trace_memory.c</file>
<line>...</line>
</frame>
+ </stack>
+ </trace>
+ <trace><text>load 0x........ size 4 (thread x / vc ...)</text>
+ <stack>
<frame>
<ip>0x........</ip>
<obj>...</obj>
- <fn>MyThread::ThreadBody(MyThread*)</fn>
+ <fn>main</fn>
<dir>...</dir>
- <file>tsan_thread_wrappers_pthread.h</file>
+ <file>annotate_trace_memory.c</file>
<line>...</line>
</frame>
</stack>
</trace>
- <trace><text>store 0x........ size 4 val 0x........ (thread x / vc ...)</text>
+ <trace><text>store 0x........ size 4 val 1077936128/0x........ (thread x / vc ...)</text>
<stack>
<frame>
<ip>0x........</ip>
<obj>...</obj>
- <fn>test01::Parent()</fn>
+ <fn>main</fn>
<dir>...</dir>
- <file>tsan_unittest.cpp</file>
+ <file>annotate_trace_memory.c</file>
<line>...</line>
</frame>
+ </stack>
+ </trace>
+double
+ <trace><text>store 0x........ size 8 val 4613937818241073152/0x........ (thread x / vc ...)</text>
+ <stack>
<frame>
<ip>0x........</ip>
<obj>...</obj>
- <fn>test01::Run()</fn>
+ <fn>main</fn>
<dir>...</dir>
- <file>tsan_unittest.cpp</file>
+ <file>annotate_trace_memory.c</file>
<line>...</line>
</frame>
</stack>
</trace>
-<error>
- <unique>0x........</unique>
- <tid>...</tid>
- <kind>ConflictingAccess</kind>
- <what>Conflicting store by thread x at 0x........ size 4</what>
+ <trace><text>load 0x........ size 8 (thread x / vc ...)</text>
<stack>
<frame>
<ip>0x........</ip>
<obj>...</obj>
- <fn>test01::Parent()</fn>
+ <fn>main</fn>
<dir>...</dir>
- <file>tsan_unittest.cpp</file>
+ <file>annotate_trace_memory.c</file>
<line>...</line>
</frame>
+ </stack>
+ </trace>
+ <trace><text>store 0x........ size 8 val 4619567317775286272/0x........ (thread x / vc ...)</text>
+ <stack>
<frame>
<ip>0x........</ip>
<obj>...</obj>
- <fn>test01::Run()</fn>
+ <fn>main</fn>
<dir>...</dir>
- <file>tsan_unittest.cpp</file>
+ <file>annotate_trace_memory.c</file>
<line>...</line>
</frame>
</stack>
- <auxwhat>Allocation context: BSS section of tsan_unittest</auxwhat>
-</error>
-
+ </trace>
+uint8_t
+ <trace><text>store 0x........ size 1 val 5/0x........ (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
+ <trace><text>load 0x........ size 1 (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
+ <trace><text>store 0x........ size 1 val 11/0x........ (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
+uint16_t
+ <trace><text>store 0x........ size 2 val 7/0x........ (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
+ <trace><text>load 0x........ size 2 (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
+ <trace><text>store 0x........ size 2 val 8/0x........ (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
+uint32_t
+ <trace><text>store 0x........ size 4 val 8/0x........ (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
<trace><text>load 0x........ size 4 (thread x / vc ...)</text>
<stack>
<frame>
<ip>0x........</ip>
<obj>...</obj>
- <fn>test01::Run()</fn>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
+ <trace><text>store 0x........ size 4 val 9/0x........ (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
+uint64_t
+ <trace><text>store 0x........ size 8 val 9/0x........ (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
<dir>...</dir>
- <file>tsan_unittest.cpp</file>
+ <file>annotate_trace_memory.c</file>
<line>...</line>
</frame>
+ </stack>
+ </trace>
+ <trace><text>load 0x........ size 8 (thread x / vc ...)</text>
+ <stack>
+ <frame>
+ <ip>0x........</ip>
+ <obj>...</obj>
+ <fn>main</fn>
+ <dir>...</dir>
+ <file>annotate_trace_memory.c</file>
+ <line>...</line>
+ </frame>
+ </stack>
+ </trace>
+ <trace><text>store 0x........ size 8 val 305419905/0x........ (thread x / vc ...)</text>
+ <stack>
<frame>
<ip>0x........</ip>
<obj>...</obj>
- <fn>Test::Run()</fn>
+ <fn>main</fn>
<dir>...</dir>
- <file>tsan_unittest.cpp</file>
+ <file>annotate_trace_memory.c</file>
<line>...</line>
</frame>
</stack>
</trace>
- GLOB=2
+Done.
<status>
<state>FINISHED</state>
</status>
<errorcounts>
- <pair>
- <count>...</count>
- <unique>0x........</unique>
- </pair>
</errorcounts>
<suppcounts>...</suppcounts>
-prereq: test -e tsan_unittest && ./supported_libpthread
+prereq: test -e annotate_trace_memory && ./supported_libpthread
vgopts: --read-var-info=yes --check-stack-var=yes --show-confl-seg=no --num-callers=2 --xml=yes --xml-fd=2
-prog: tsan_unittest
-args: 1
+prog: annotate_trace_memory
stderr_filter: ./filter_xml_and_thread_no