// Local variables.
-static Bool s_drd_check_stack_var = False;
-static Bool s_drd_print_stats = False;
-static Bool s_drd_trace_fork_join = False;
-static Bool s_drd_var_info = False;
-static Bool s_show_stack_usage = False;
+static Bool s_drd_check_stack_accesses = False;
+static Bool s_drd_print_stats = False;
+static Bool s_drd_trace_fork_join = False;
+static Bool s_drd_var_info = False;
+static Bool s_show_stack_usage = False;
//
static Bool drd_process_cmd_line_option(Char* arg)
{
int exclusive_threshold_ms = -1;
- int segment_merging = -1;
+ int segment_merging = -1;
int shared_threshold_ms = -1;
- int show_confl_seg = -1;
- int trace_barrier = -1;
- int trace_clientobj = -1;
- int trace_cond = -1;
- int trace_csw = -1;
- int trace_danger_set = -1;
- int trace_mutex = -1;
- int trace_rwlock = -1;
- int trace_segment = -1;
- int trace_semaphore = -1;
- int trace_suppression = -1;
- Char* trace_address = 0;
-
- VG_BOOL_CLO (arg, "--check-stack-var", s_drd_check_stack_var)
+ int show_confl_seg = -1;
+ int trace_barrier = -1;
+ int trace_clientobj = -1;
+ int trace_cond = -1;
+ int trace_csw = -1;
+ int trace_danger_set = -1;
+ int trace_mutex = -1;
+ int trace_rwlock = -1;
+ int trace_segment = -1;
+ int trace_semaphore = -1;
+ int trace_suppression = -1;
+ Char* trace_address = 0;
+
+ VG_BOOL_CLO (arg, "--check-stack-var", s_drd_check_stack_accesses)
else VG_BOOL_CLO(arg, "--drd-stats", s_drd_print_stats)
else VG_BOOL_CLO(arg, "--segment-merging", segment_merging)
else VG_BOOL_CLO(arg, "--show-confl-seg", show_confl_seg)
{
drd_trace_mem_access(addr, size, eLoad);
}
- if (bm_access_load_triggers_conflict(addr, addr + size))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_load_triggers_conflict(addr, addr + size))
{
drd_report_race(addr, size, eLoad);
}
{
drd_trace_mem_access(addr, 1, eLoad);
}
- if (bm_access_load_1_triggers_conflict(addr))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_load_1_triggers_conflict(addr))
{
drd_report_race(addr, 1, eLoad);
}
{
drd_trace_mem_access(addr, 2, eLoad);
}
- if (bm_access_load_2_triggers_conflict(addr))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_load_2_triggers_conflict(addr))
{
drd_report_race(addr, 2, eLoad);
}
{
drd_trace_mem_access(addr, 4, eLoad);
}
- if (bm_access_load_4_triggers_conflict(addr))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_load_4_triggers_conflict(addr))
{
drd_report_race(addr, 4, eLoad);
}
{
drd_trace_mem_access(addr, 8, eLoad);
}
- if (bm_access_load_8_triggers_conflict(addr))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_load_8_triggers_conflict(addr))
{
drd_report_race(addr, 8, eLoad);
}
{
drd_trace_mem_access(addr, size, eStore);
}
- if (bm_access_store_triggers_conflict(addr, addr + size))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_store_triggers_conflict(addr, addr + size))
{
drd_report_race(addr, size, eStore);
}
{
drd_trace_mem_access(addr, 1, eStore);
}
- if (bm_access_store_1_triggers_conflict(addr))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_store_1_triggers_conflict(addr))
{
drd_report_race(addr, 1, eStore);
}
{
drd_trace_mem_access(addr, 2, eStore);
}
- if (bm_access_store_2_triggers_conflict(addr))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_store_2_triggers_conflict(addr))
{
drd_report_race(addr, 2, eStore);
}
{
drd_trace_mem_access(addr, 4, eStore);
}
- if (bm_access_store_4_triggers_conflict(addr))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_store_4_triggers_conflict(addr))
{
drd_report_race(addr, 4, eStore);
}
{
drd_trace_mem_access(addr, 8, eStore);
}
- if (bm_access_store_8_triggers_conflict(addr))
+ if ((s_drd_check_stack_accesses || ! thread_address_on_stack(addr))
+ && bm_access_store_8_triggers_conflict(addr))
{
drd_report_race(addr, 8, eStore);
}
}
}
-static void drd_start_using_mem(const Addr a1, const SizeT len)
+static __inline__
+void drd_start_using_mem(const Addr a1, const SizeT len)
{
tl_assert(a1 < a1 + len);
{
drd_trace_mem_access(a1, len, eEnd);
}
- if (! is_stack_mem || s_drd_check_stack_var)
+ if (! is_stack_mem || s_drd_check_stack_accesses)
{
thread_stop_using_mem(a1, a2);
clientobj_stop_using_mem(a1, a2);
/* Called by the core when the stack of a thread grows, to indicate that */
/* the addresses in range [ a, a + len [ may now be used by the client. */
/* Assumption: stacks grow downward. */
-static void drd_start_using_mem_stack(const Addr a, const SizeT len)
+static __inline__
+void drd_start_using_mem_stack(const Addr a, const SizeT len)
{
thread_set_stack_min(thread_get_running_tid(), a - VG_STACK_REDZONE_SZB);
drd_start_using_mem(a - VG_STACK_REDZONE_SZB,
/* Called by the core when the stack of a thread shrinks, to indicate that */
/* the addresses [ a, a + len [ are no longer accessible for the client. */
/* Assumption: stacks grow downward. */
-static void drd_stop_using_mem_stack(const Addr a, const SizeT len)
+static __inline__
+void drd_stop_using_mem_stack(const Addr a, const SizeT len)
{
thread_set_stack_min(thread_get_running_tid(),
a + len - VG_STACK_REDZONE_SZB);
"drd_post_thread_create created = %d/%d",
vg_created, drd_created);
}
- if (! s_drd_check_stack_var)
+ if (! s_drd_check_stack_accesses)
{
drd_start_suppression(thread_get_stack_max(drd_created)
- thread_get_stack_size(drd_created),
VG_(free)(msg);
}
- if (! s_drd_check_stack_var)
+ if (! s_drd_check_stack_accesses)
{
drd_finish_suppression(thread_get_stack_max(drd_joinee)
- thread_get_stack_size(drd_joinee),
# Results: (-p1) (-p2) (-p3) (-p4) ITC (-p4) ITC (-p4)
# original w/ filter
# .........................................................................
-# Cholesky 39 49 ? 81 239 82
-# FFT 15 16 N/A 43 90 41
-# LU, contiguous blocks 38 39 ? 43 428 128
-# LU, non-contiguous blocks 32 34 ? 41 428 128
-# Ocean, contiguous partitions 19 23 N/A 29 90 28
-# Ocean, non-continguous partns 18 21 N/A 31 90 28
-# Radiosity 92 92 ? 92 485 163
-# Radix 11 14 ? 16 222 56
-# Raytrace 70 70 ? 70 172 53
-# Water-n2 50 50 ? 50 189 39
-# Water-sp 49 48 ? 49 183 34
+# Cholesky 40 47 ? 82 239 82
+# FFT 16 17 N/A 47 90 41
+# LU, contiguous blocks 39 41 ? 45 428 128
+# LU, non-contiguous blocks 39 41 ? 49 428 128
+# Ocean, contiguous partitions 17 19 N/A 25 90 28
+# Ocean, non-continguous partns 18 21 N/A 30 90 28
+# Radiosity 78 78 ? 78 485 163
+# Radix 10 12 ? 15 222 56
+# Raytrace 56 56 ? 56 172 53
+# Water-n2 34 34 ? 34 189 39
+# Water-sp 33 33 ? 33 183 34
#
# Hardware: dual-core Intel Xeon 5130, 1.995 MHz, 4 MB L2 cache, 4 GB RAM.
# Software: Ubuntu 7.10 server, 64-bit (includes gcc 4.1.3).