|
From: <sv...@va...> - 2011-12-12 19:07:15
|
Author: bart
Date: 2011-12-12 19:02:34 +0000 (Mon, 12 Dec 2011)
New Revision: 12295
Log:
DRD: make DRD_(stop_tracing_address_range)() work at an acceptable speed
Modified:
trunk/drd/drd_bitmap.c
trunk/drd/drd_suppression.c
trunk/drd/pub_drd_bitmap.h
Modified: trunk/drd/drd_bitmap.c
===================================================================
--- trunk/drd/drd_bitmap.c 2011-12-12 15:49:00 UTC (rev 12294)
+++ trunk/drd/drd_bitmap.c 2011-12-12 19:02:34 UTC (rev 12295)
@@ -327,6 +327,29 @@
return DRD_(bm_has_any_store)(bm, a1, a2);
}
+Bool DRD_(bm_has_any_load_g)(struct bitmap* const bm)
+{
+ struct bitmap2* bm2;
+
+ tl_assert(bm);
+
+ VG_(OSetGen_ResetIter)(bm->oset);
+ for ( ; (bm2 = VG_(OSetGen_Next)(bm->oset)) != NULL; ) {
+ Addr b_start;
+ Addr b_end;
+ UWord b0;
+ const struct bitmap1* const p1 = &bm2->bm1;
+
+ b_start = make_address(bm2->addr, 0);
+ b_end = make_address(bm2->addr + 1, 0);
+
+ for (b0 = address_lsb(b_start); b0 <= address_lsb(b_end - 1); b0++)
+ if (bm0_is_set(p1->bm0_r, b0))
+ return True;
+ }
+ return False;
+}
+
Bool
DRD_(bm_has_any_load)(struct bitmap* const bm, const Addr a1, const Addr a2)
{
Modified: trunk/drd/drd_suppression.c
===================================================================
--- trunk/drd/drd_suppression.c 2011-12-12 15:49:00 UTC (rev 12294)
+++ trunk/drd/drd_suppression.c 2011-12-12 19:02:34 UTC (rev 12295)
@@ -132,10 +132,8 @@
DRD_(bm_clear_load)(DRD_(s_traced), a1, a2);
if (DRD_(g_any_address_traced))
- {
DRD_(g_any_address_traced)
- = DRD_(bm_has_any_load)(DRD_(s_traced), 0, ~(Addr)0);
- }
+ = DRD_(bm_has_any_load_g)(DRD_(s_traced));
}
Bool DRD_(is_any_traced)(const Addr a1, const Addr a2)
Modified: trunk/drd/pub_drd_bitmap.h
===================================================================
--- trunk/drd/pub_drd_bitmap.h 2011-12-12 15:49:00 UTC (rev 12294)
+++ trunk/drd/pub_drd_bitmap.h 2011-12-12 19:02:34 UTC (rev 12295)
@@ -97,6 +97,7 @@
Bool DRD_(bm_has)(struct bitmap* const bm,
const Addr a1, const Addr a2,
const BmAccessTypeT access_type);
+Bool DRD_(bm_has_any_load_g)(struct bitmap* const bm);
Bool DRD_(bm_has_any_load)(struct bitmap* const bm,
const Addr a1, const Addr a2);
Bool DRD_(bm_has_any_store)(struct bitmap* const bm,
|