You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
| 2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
| 2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
| 2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
| 2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
| 2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
| 2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
| 2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
| 2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
| 2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
| 2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
| 2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
| 2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
| 2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
| 2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
| 2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
| 2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
| 2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
| 2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
| 2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
| 2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(10) |
2
(8) |
3
(17) |
4
(28) |
5
(22) |
6
(8) |
|
7
(8) |
8
(22) |
9
(12) |
10
(17) |
11
(14) |
12
(15) |
13
(6) |
|
14
(9) |
15
(9) |
16
(16) |
17
(13) |
18
(18) |
19
(7) |
20
(5) |
|
21
(6) |
22
(5) |
23
(11) |
24
(5) |
25
(11) |
26
(7) |
27
(15) |
|
28
(11) |
29
(12) |
30
(12) |
31
(15) |
|
|
|
|
From: <sv...@va...> - 2007-10-15 21:58:54
|
Author: sewardj
Date: 2007-10-15 22:58:54 +0100 (Mon, 15 Oct 2007)
New Revision: 6998
Log:
Add a regression test demonstrating byte-level lockset tracking.
Added:
branches/THRCHECK/thrcheck/tests/tc16_byterace.c
branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp
branches/THRCHECK/thrcheck/tests/tc16_byterace.stdout.exp
branches/THRCHECK/thrcheck/tests/tc16_byterace.vgtest
Modified:
branches/THRCHECK/thrcheck/tests/Makefile.am
Modified: branches/THRCHECK/thrcheck/tests/Makefile.am
===================================================================
--- branches/THRCHECK/thrcheck/tests/Makefile.am 2007-10-15 21:56:19 UTC (rev 6997)
+++ branches/THRCHECK/thrcheck/tests/Makefile.am 2007-10-15 21:58:54 UTC (rev 6998)
@@ -40,7 +40,9 @@
tc14_laog_dinphils.vgtest tc14_laog_dinphils.stderr.exp \
tc14_laog_dinphils.stdout.exp \
tc15_laog_lockdel.vgtest tc15_laog_lockdel.stderr.exp \
- tc15_laog_lockdel.stdout.exp
+ tc15_laog_lockdel.stdout.exp \
+ tc16_byterace.vgtest tc16_byterace.stderr.exp \
+ tc16_byterace.stdout.exp
check_PROGRAMS = \
hg01_all_ok \
@@ -63,7 +65,8 @@
tc12_rwl_trivial \
tc13_laog1 \
tc14_laog_dinphils \
- tc15_laog_lockdel
+ tc15_laog_lockdel \
+ tc16_byterace
# is this necessary?
AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow -g $(AM_FLAG_M3264_PRI)
Added: branches/THRCHECK/thrcheck/tests/tc16_byterace.c
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc16_byterace.c (rev 0)
+++ branches/THRCHECK/thrcheck/tests/tc16_byterace.c 2007-10-15 21:58:54 UTC (rev 6998)
@@ -0,0 +1,42 @@
+#include <pthread.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* Simple demonstration of lockset tracking at byte granularity. */
+
+char bytes[10];
+
+void* child_fn ( void* arg )
+{
+ int i;
+ for (i = 0; i < 5; i++)
+ bytes[2*i + 0] ++;
+ return NULL;
+}
+
+int main ( void )
+{
+ int i;
+ pthread_t child;
+
+ if (pthread_create(&child, NULL, child_fn, NULL)) {
+ perror("pthread_create");
+ exit(1);
+ }
+
+ /* Unprotected relative to child, but harmless, since different
+ bytes accessed */
+ for (i = 0; i < 5; i++)
+ bytes[2*i + 1] ++;
+
+ /* Unprotected relative to child, but harmful; same bytes */
+ for (i = 0; i < 3; i++)
+ bytes[3*i + 1] ++;
+
+ if (pthread_join(child, NULL)) {
+ perror("pthread join");
+ exit(1);
+ }
+
+ return 0;
+}
Added: branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp (rev 0)
+++ branches/THRCHECK/thrcheck/tests/tc16_byterace.stderr.exp 2007-10-15 21:58:54 UTC (rev 6998)
@@ -0,0 +1,18 @@
+
+Thread #1 is the program's root thread
+
+Thread #2 was created
+ at 0x........: clone (in /...libc...)
+ by 0x........: ...
+ by 0x........: pthread_create@@GLIBC_2.2.5 (in /lib/libpthread...)
+ by 0x........: pthread_create@* (tc_intercepts.c:...)
+ by 0x........: main (tc16_byterace.c:22)
+
+Possible data race during write to 0x........
+ at 0x........: main (tc16_byterace.c:34)
+ Old state: shared-readonly by threads #1, #2
+ New state: shared-modified by threads #1, #2
+ Reason: this thread, #1, holds no consistent locks
+ Location 0x........ has never been protected by any lock
+
+ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
Added: branches/THRCHECK/thrcheck/tests/tc16_byterace.stdout.exp
===================================================================
Added: branches/THRCHECK/thrcheck/tests/tc16_byterace.vgtest
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc16_byterace.vgtest (rev 0)
+++ branches/THRCHECK/thrcheck/tests/tc16_byterace.vgtest 2007-10-15 21:58:54 UTC (rev 6998)
@@ -0,0 +1 @@
+prog: tc16_byterace
|
|
From: <sv...@va...> - 2007-10-15 21:56:18
|
Author: sewardj
Date: 2007-10-15 22:56:19 +0100 (Mon, 15 Oct 2007)
New Revision: 6997
Log:
Update expected outputs.
Modified:
branches/THRCHECK/thrcheck/tests/tc10_rec_lock.stderr.exp
branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.stderr.exp
Modified: branches/THRCHECK/thrcheck/tests/tc10_rec_lock.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc10_rec_lock.stderr.exp 2007-10-15 19:51:38 UTC (rev 6996)
+++ branches/THRCHECK/thrcheck/tests/tc10_rec_lock.stderr.exp 2007-10-15 21:56:19 UTC (rev 6997)
@@ -10,17 +10,17 @@
Thread #1 unlocked a not-locked lock at 0x........
at 0x........: pthread_mutex_unlock (tc_intercepts.c:...)
- by 0x........: nearly_main (tc10_rec_lock.c:53)
- by 0x........: main (tc10_rec_lock.c:58)
+ by 0x........: nearly_main (tc10_rec_lock.c:42)
+ by 0x........: main (tc10_rec_lock.c:47)
Lock at 0x........ was first observed
at 0x........: pthread_mutex_init (tc_intercepts.c:...)
- by 0x........: nearly_main (tc10_rec_lock.c:35)
- by 0x........: main (tc10_rec_lock.c:58)
+ by 0x........: nearly_main (tc10_rec_lock.c:24)
+ by 0x........: main (tc10_rec_lock.c:47)
Thread #1's call to pthread_mutex_unlock failed
with error code 1 (EPERM: Operation not permitted)
at 0x........: pthread_mutex_unlock (tc_intercepts.c:...)
- by 0x........: nearly_main (tc10_rec_lock.c:53)
- by 0x........: main (tc10_rec_lock.c:58)
+ by 0x........: nearly_main (tc10_rec_lock.c:42)
+ by 0x........: main (tc10_rec_lock.c:47)
ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)
Modified: branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.stderr.exp
===================================================================
--- branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.stderr.exp 2007-10-15 19:51:38 UTC (rev 6996)
+++ branches/THRCHECK/thrcheck/tests/tc12_rwl_trivial.stderr.exp 2007-10-15 21:56:19 UTC (rev 6997)
@@ -3,9 +3,9 @@
Thread #1 unlocked a not-locked lock at 0x........
at 0x........: pthread_rwlock_unlock (tc_intercepts.c:...)
- by 0x........: main (tc12_rwl_trivial.c:24)
+ by 0x........: main (tc12_rwl_trivial.c:29)
Lock at 0x........ was first observed
at 0x........: pthread_rwlock_init (tc_intercepts.c:...)
- by 0x........: main (tc12_rwl_trivial.c:13)
+ by 0x........: main (tc12_rwl_trivial.c:18)
ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
|
|
From: <sv...@va...> - 2007-10-15 19:51:37
|
Author: sewardj
Date: 2007-10-15 20:51:38 +0100 (Mon, 15 Oct 2007)
New Revision: 6996
Log:
* switch back to a direct mapped cache. 2-way causes insignificant
reduction in miss rate and makes the common path slower
* increase size of said cache to 2^16 entries
* merge cache flushing and invalidation, so as to be more CPU-cache
friendly
Modified:
branches/THRCHECK/thrcheck/tc_main.c
Modified: branches/THRCHECK/thrcheck/tc_main.c
===================================================================
--- branches/THRCHECK/thrcheck/tc_main.c 2007-10-15 16:21:07 UTC (rev 6995)
+++ branches/THRCHECK/thrcheck/tc_main.c 2007-10-15 19:51:38 UTC (rev 6996)
@@ -432,7 +432,7 @@
/* ------ Cache ------ */
-#define N_WAY_BITS 12
+#define N_WAY_BITS 16
#define N_WAY_NENT (1 << N_WAY_BITS)
/* Each tag is the address of the associated CacheLine, rounded down
@@ -445,9 +445,7 @@
typedef
struct {
CacheLine lyns0[N_WAY_NENT];
- CacheLine lyns1[N_WAY_NENT];
Addr tags0[N_WAY_NENT];
- Addr tags1[N_WAY_NENT];
}
Cache;
@@ -2164,20 +2162,6 @@
for (j = i+1; j < N_WAY_NENT; j++)
if (cache_shmem.tags0[j] == tag) BAD("17-0");
}
- /* way1 */
- cl = &cache_shmem.lyns1[i];
- tag = cache_shmem.tags1[i];
- if (tag != 1) {
- if (!is_valid_scache_tag(tag)) BAD("14-1");
- if (!is_sane_CacheLine(cl)) BAD("15-1");
- if (tag & (N_LINE_W8s-1)) BAD("16-1");
- for (j = i+1; j < N_WAY_NENT; j++)
- if (cache_shmem.tags1[j] == tag) BAD("17-1");
- }
- /* and also */
- if (cache_shmem.tags0[i] != 1 && cache_shmem.tags1[i] != 1
- && cache_shmem.tags0[i] == cache_shmem.tags1[i])
- BAD("18");
}
return;
@@ -3023,7 +3007,7 @@
}
-static __attribute__((noinline)) void cacheline_wback ( UWord way, UWord wix )
+static __attribute__((noinline)) void cacheline_wback ( UWord wix )
{
Word i, j;
Bool anyShared = False;
@@ -3037,18 +3021,12 @@
UInt sv;
if (0)
- VG_(printf)("scache wback way %d line %d\n", (Int)way, (Int)wix);
+ VG_(printf)("scache wback line %d\n", (Int)wix);
- tl_assert(way >= 0 && way < 2);
tl_assert(wix >= 0 && wix < N_WAY_NENT);
- if (way == 0) {
- tag = cache_shmem.tags0[wix];
- cl = &cache_shmem.lyns0[wix];
- } else {
- tag = cache_shmem.tags1[wix];
- cl = &cache_shmem.lyns1[wix];
- }
+ tag = cache_shmem.tags0[wix];
+ cl = &cache_shmem.lyns0[wix];
/* The cache line may have been invalidated; if so, ignore it. */
if (!is_valid_scache_tag(tag))
@@ -3125,7 +3103,7 @@
associated with 'wix' is assumed to have already been filled in;
hence that is used to determine where in the backing store to read
from. */
-static __attribute__((noinline)) void cacheline_fetch ( UWord way, UWord wix )
+static __attribute__((noinline)) void cacheline_fetch ( UWord wix )
{
Word i;
Addr tag;
@@ -3134,18 +3112,12 @@
CacheLineF* lineF;
if (0)
- VG_(printf)("scache fetch way %d line %d\n", (Int)way, (Int)wix);
+ VG_(printf)("scache fetch line %d\n", (Int)wix);
- tl_assert(way >= 0 && way < 2);
tl_assert(wix >= 0 && wix < N_WAY_NENT);
- if (way == 0) {
- tag = cache_shmem.tags0[wix];
- cl = &cache_shmem.lyns0[wix];
- } else {
- tag = cache_shmem.tags1[wix];
- cl = &cache_shmem.lyns1[wix];
- }
+ tag = cache_shmem.tags0[wix];
+ cl = &cache_shmem.lyns0[wix];
/* reject nonsense requests */
tl_assert(is_valid_scache_tag(tag));
@@ -3177,23 +3149,31 @@
cacheline_normalise( cl );
}
-static void shmem__flush_scache ( void ) {
+static void shmem__invalidate_scache ( void ) {
Word wix;
- if (0) VG_(printf)("scache flush\n");
+ if (0) VG_(printf)("scache inval\n");
+ tl_assert(!is_valid_scache_tag(1));
for (wix = 0; wix < N_WAY_NENT; wix++) {
- cacheline_wback( 0, wix );
- cacheline_wback( 1, wix );
+ cache_shmem.tags0[wix] = 1/*INVALID*/;
}
- stats__cache_flushes++;
+ stats__cache_invals++;
}
-static void shmem__invalidate_scache ( void ) {
+static void shmem__flush_and_invalidate_scache ( void ) {
Word wix;
- if (0) VG_(printf)("scache inval\n");
+ Addr tag;
+ if (0) VG_(printf)("scache flush and invalidate\n");
tl_assert(!is_valid_scache_tag(1));
for (wix = 0; wix < N_WAY_NENT; wix++) {
+ tag = cache_shmem.tags0[wix];
+ if (tag == 1/*INVALID*/) {
+ /* already invalid; nothing to do */
+ } else {
+ tl_assert(is_valid_scache_tag(tag));
+ cacheline_wback( wix );
+ }
cache_shmem.tags0[wix] = 1/*INVALID*/;
- cache_shmem.tags1[wix] = 1/*INVALID*/;
}
+ stats__cache_flushes++;
stats__cache_invals++;
}
@@ -3219,12 +3199,11 @@
Addr tag = a & ~(N_LINE_W8s - 1);
UWord wix = (a >> N_LINE_BITS) & (N_WAY_NENT - 1);
stats__cache_totrefs++;
- /* Check both Ways */
- if (LIKELY(tag == cache_shmem.tags0[wix]))
+ if (LIKELY(tag == cache_shmem.tags0[wix])) {
return &cache_shmem.lyns0[wix];
- if (LIKELY(tag == cache_shmem.tags1[wix]))
- return &cache_shmem.lyns1[wix];
- return get_cacheline_MISS( a );
+ } else {
+ return get_cacheline_MISS( a );
+ }
}
static __attribute__((noinline))
@@ -3232,41 +3211,28 @@
{
/* tag is 'a' with the in-line offset masked out,
eg a[31]..a[4] 0000 */
- static UWord seed = 0;
CacheLine* cl;
Addr* tag_old_p;
- UWord way;
Addr tag = a & ~(N_LINE_W8s - 1);
UWord wix = (a >> N_LINE_BITS) & (N_WAY_NENT - 1);
- /* Check both Ways */
tl_assert(tag != cache_shmem.tags0[wix]);
- tl_assert(tag != cache_shmem.tags1[wix]);
/* Dump the old line into the backing store. */
stats__cache_totmisses++;
- /* arbitrarily choose the way to dump (not very scientific) */
- way = seed & 1;
- seed++; if (seed == 1021) seed = 0; /* 1021 is prime */
+ cl = &cache_shmem.lyns0[wix];
+ tag_old_p = &cache_shmem.tags0[wix];
- if (way == 0) {
- cl = &cache_shmem.lyns0[wix];
- tag_old_p = &cache_shmem.tags0[wix];
- } else {
- cl = &cache_shmem.lyns1[wix];
- tag_old_p = &cache_shmem.tags1[wix];
- }
-
if (is_valid_scache_tag( *tag_old_p )) {
/* EXPENSIVE and REDUNDANT: callee does it
tl_assert(is_sane_CacheLine( cl )); */
- cacheline_wback( way, wix );
+ cacheline_wback( wix );
}
/* and reload the new one */
*tag_old_p = tag;
- cacheline_fetch( way, wix );
+ cacheline_fetch( wix );
/* EXPENSIVE tl_assert(is_sane_CacheLine( cl )); */
return cl;
}
@@ -3380,6 +3346,7 @@
shadow_mem_read16( thr_acc, a + 0, 0/*unused*/ );
shadow_mem_read16( thr_acc, a + 2, 0/*unused*/ );
}
+inline
static void shadow_mem_read64 ( Thread* thr_acc, Addr a, UInt uuOpaque ) {
CacheLine* cl;
UWord ix64;
@@ -3910,8 +3877,7 @@
/* --- Step 6 --- */
- shmem__flush_scache();
- shmem__invalidate_scache();
+ shmem__flush_and_invalidate_scache();
/* --- Step 7 --- */
@@ -4564,8 +4530,7 @@
invalidate cache_shmem, so that subsequent memory references get
up to date shadow values.
*/
- shmem__flush_scache();
- shmem__invalidate_scache();
+ shmem__flush_and_invalidate_scache();
stats_SMs = stats_SMs_scanned = stats_reExcls = 0;
TC_(initIterFM)( map_shmem );
|
|
From: <sv...@va...> - 2007-10-15 16:21:09
|
Author: sewardj
Date: 2007-10-15 17:21:07 +0100 (Mon, 15 Oct 2007)
New Revision: 6995
Log:
Still working on the case of "Where Are My Missing Cycles?"
Modified:
branches/THRCHECK/thrcheck/tc_main.c
Modified: branches/THRCHECK/thrcheck/tc_main.c
===================================================================
--- branches/THRCHECK/thrcheck/tc_main.c 2007-10-14 17:25:22 UTC (rev 6994)
+++ branches/THRCHECK/thrcheck/tc_main.c 2007-10-15 16:21:07 UTC (rev 6995)
@@ -3023,45 +3023,6 @@
}
-static void mb_tidy_one_cacheline ( void )
-{
- Word i;
- UInt shvals[N_LINE_W8s];
- CacheLine* cl;
- Addr tag;
-
- static UWord way = 0; /* 0 .. 1 */
- static UWord lno = 0; /* 0 .. N_WAY_NENT-1 */
-
- if (way == 0) {
- tag = cache_shmem.tags0[way];
- cl = &cache_shmem.lyns0[way];
- } else {
- tag = cache_shmem.tags1[way];
- cl = &cache_shmem.lyns1[way];
- }
-
- /* move cursor on */
- lno++;
- if (lno == N_WAY_NENT) {
- lno = 0;
- way++;
- if (way == 2) way = 0;
- }
- tl_assert(way >= 0 && way < 2);
- tl_assert(lno >= 0 && lno < N_WAY_NENT);
-
- if (is_valid_scache_tag(tag)) {
- if (0) VG_(printf)("tidying %d %d\n", (Int)way, (Int)lno);
- /* tidy up line (way,lno) */
- (void)sequentialise_into( shvals, N_LINE_W8s, cl );
- for (i = 0; i < N_LINE_W8s; i++)
- cl->w8[i] = shvals[i];
- cacheline_normalise( cl );
- }
-}
-
-
static __attribute__((noinline)) void cacheline_wback ( UWord way, UWord wix )
{
Word i, j;
@@ -3395,6 +3356,7 @@
shadow_mem_read8( thr_acc, a + 0, 0/*unused*/ );
shadow_mem_read8( thr_acc, a + 1, 0/*unused*/ );
}
+inline
static void shadow_mem_read32 ( Thread* thr_acc, Addr a, UInt uuOpaque ) {
CacheLine* cl;
UWord ix32;
@@ -3480,6 +3442,7 @@
shadow_mem_write8( thr_acc, a + 0, 0/*unused*/ );
shadow_mem_write8( thr_acc, a + 1, 0/*unused*/ );
}
+/* inline */
static void shadow_mem_write32 ( Thread* thr_acc, Addr a, UInt uuOpaque ) {
CacheLine* cl;
UWord ix32;
@@ -4336,15 +4299,50 @@
/*--------- Event handlers proper (evh__* functions) ---------*/
-/* FIXME: Horrible inefficient hack. Get rid of it somehow. */
-// FIXME: get rid of the "if .." hack. It exists because evim__new_mem
-// is called during initialisation (as notification of initial memory
-// layout) and VG_(get_running_tid)() returns VG_INVALID_THREADID at
-// that point.
+/* What is the Thread* for the currently running thread? This is
+ absolutely performance critical. We receive notifications from the
+ core for client code starts/stops, and cache the looked-up result
+ in 'current_Thread'. Hence, for the vast majority of requests,
+ finding the current thread reduces to a read of a global variable,
+ provided get_current_Thread_in_C_C is inlined.
+
+ Outside of client code, current_Thread is NULL, and presumably
+ any uses of it will cause a segfault. Hence:
+
+ - for uses definitely within client code, use
+ get_current_Thread_in_C_C.
+
+ - for all other uses, use get_current_Thread_general.
+*/
+
+static Thread* current_Thread = NULL;
+
+static void evh__start_client_code ( ThreadId tid, ULong nDisp ) {
+ if (0) VG_(printf)("start %d %llu\n", (Int)tid, nDisp);
+ tl_assert(current_Thread == NULL);
+ current_Thread = map_threads_lookup( tid );
+ tl_assert(current_Thread != NULL);
+}
+static void evh__stop_client_code ( ThreadId tid, ULong nDisp ) {
+ if (0) VG_(printf)(" stop %d %llu\n", (Int)tid, nDisp);
+ tl_assert(current_Thread != NULL);
+ current_Thread = NULL;
+}
+static inline Thread* get_current_Thread_in_C_C ( void ) {
+ return current_Thread;
+}
static inline Thread* get_current_Thread ( void ) {
ThreadId coretid;
Thread* thr;
+ thr = get_current_Thread_in_C_C();
+ if (LIKELY(thr))
+ return thr;
+ /* evidently not in client code. Do it the slow way. */
coretid = VG_(get_running_tid)();
+ /* FIXME: get rid of the following kludge. It exists because
+ evim__new_mem is called during initialisation (as notification
+ of initial memory layout) and VG_(get_running_tid)() returns
+ VG_INVALID_THREADID at that point. */
if (coretid == VG_INVALID_THREADID)
coretid = 1; /* KLUDGE */
thr = map_threads_lookup( coretid );
@@ -4711,57 +4709,57 @@
static VG_REGPARM(1)
void evh__mem_help_read_1(Addr a) {
- shadow_mem_read8( get_current_Thread(), a, 0/*unused*/ );
+ shadow_mem_read8( get_current_Thread_in_C_C(), a, 0/*unused*/ );
}
static VG_REGPARM(1)
void evh__mem_help_read_2(Addr a) {
- shadow_mem_read16( get_current_Thread(), a, 0/*unused*/ );
+ shadow_mem_read16( get_current_Thread_in_C_C(), a, 0/*unused*/ );
}
static VG_REGPARM(1)
void evh__mem_help_read_4(Addr a) {
- shadow_mem_read32( get_current_Thread(), a, 0/*unused*/ );
+ shadow_mem_read32( get_current_Thread_in_C_C(), a, 0/*unused*/ );
}
static VG_REGPARM(1)
void evh__mem_help_read_8(Addr a) {
- shadow_mem_read64( get_current_Thread(), a, 0/*unused*/ );
+ shadow_mem_read64( get_current_Thread_in_C_C(), a, 0/*unused*/ );
}
static VG_REGPARM(2)
void evh__mem_help_read_N(Addr a, SizeT size) {
- shadow_mem_read_range( get_current_Thread(), a, size );
+ shadow_mem_read_range( get_current_Thread_in_C_C(), a, size );
}
static VG_REGPARM(1)
void evh__mem_help_write_1(Addr a) {
- shadow_mem_write8( get_current_Thread(), a, 0/*unused*/ );
+ shadow_mem_write8( get_current_Thread_in_C_C(), a, 0/*unused*/ );
}
static VG_REGPARM(1)
void evh__mem_help_write_2(Addr a) {
- shadow_mem_write16( get_current_Thread(), a, 0/*unused*/ );
+ shadow_mem_write16( get_current_Thread_in_C_C(), a, 0/*unused*/ );
}
static VG_REGPARM(1)
void evh__mem_help_write_4(Addr a) {
- shadow_mem_write32( get_current_Thread(), a, 0/*unused*/ );
+ shadow_mem_write32( get_current_Thread_in_C_C(), a, 0/*unused*/ );
}
static VG_REGPARM(1)
void evh__mem_help_write_8(Addr a) {
- shadow_mem_write64( get_current_Thread(), a, 0/*unused*/ );
+ shadow_mem_write64( get_current_Thread_in_C_C(), a, 0/*unused*/ );
}
static VG_REGPARM(2)
void evh__mem_help_write_N(Addr a, SizeT size) {
- shadow_mem_write_range( get_current_Thread(), a, size );
+ shadow_mem_write_range( get_current_Thread_in_C_C(), a, size );
}
static void evh__bus_lock(void) {
Thread* thr;
if (0) VG_(printf)("evh__bus_lock()\n");
- thr = map_threads_maybe_lookup( VG_(get_running_tid)() );
+ thr = get_current_Thread();
tl_assert(thr); /* cannot fail - Thread* must already exist */
evhH__post_thread_w_acquires_lock( thr, LK_nonRec, (Addr)&__bus_lock );
}
static void evh__bus_unlock(void) {
Thread* thr;
if (0) VG_(printf)("evh__bus_unlock()\n");
- thr = map_threads_maybe_lookup( VG_(get_running_tid)() );
+ thr = get_current_Thread();
tl_assert(thr); /* cannot fail - Thread* must already exist */
evhH__pre_thread_releases_lock( thr, (Addr)&__bus_lock, False/*!isRDWR*/ );
}
@@ -7087,6 +7085,9 @@
VG_(track_pre_thread_ll_create)( evh__pre_thread_ll_create );
VG_(track_pre_thread_ll_exit) ( evh__pre_thread_ll_exit );
+ VG_(track_start_client_code)( evh__start_client_code );
+ VG_(track_stop_client_code)( evh__stop_client_code );
+
initialise_data_structures();
/* Ensure that requirements for "dodgy C-as-C++ style inheritance"
|
|
From: <js...@ac...> - 2007-10-15 14:54:34
|
Nightly build on minnie ( SuSE 10.0, ppc32 ) started at 2007-10-15 09:00:01 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 220 tests, 10 stderr failures, 6 stdout failures, 0 posttest failures == memcheck/tests/leak-tree (stderr) memcheck/tests/leakotron (stdout) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/ppc32/jm-fp (stdout) none/tests/ppc32/jm-fp (stderr) none/tests/ppc32/round (stdout) none/tests/ppc32/round (stderr) none/tests/ppc32/test_fx (stdout) none/tests/ppc32/test_fx (stderr) none/tests/ppc32/test_gx (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-15 02:32:22
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2007-10-15 03:15:02 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 260 tests, 27 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-15 02:26:46
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2007-10-15 03:05:06 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 293 tests, 4 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |
|
From: Tom H. <th...@cy...> - 2007-10-15 02:12:43
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2007-10-15 03:00:03 BST Results differ from 24 hours ago Checking out valgrind source tree ... failed Last 20 lines of verbose log follow echo Checking out valgrind source tree ... svn co svn://svn.valgrind.org/valgrind/trunk -r {2007-10-15T03:00:03} valgrind svn: Can't connect to host 'svn.valgrind.org': Connection timed out ================================================= == Results from 24 hours ago == ================================================= Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 295 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Mon Oct 15 03:09:34 2007 --- new.short Mon Oct 15 03:12:43 2007 *************** *** 1,17 **** ! Checking out valgrind source tree ... done ! Configuring valgrind ... done ! Building valgrind ... done ! Running regression tests ... failed ! Regression test results follow ! ! == 295 tests, 6 stderr failures, 1 stdout failure, 0 posttest failures == ! memcheck/tests/pointer-trace (stderr) ! memcheck/tests/stack_switch (stderr) ! memcheck/tests/x86/scalar (stderr) ! memcheck/tests/x86/scalar_supp (stderr) ! none/tests/fdleak_fcntl (stderr) ! none/tests/mremap (stderr) ! none/tests/mremap2 (stdout) --- 1,7 ---- ! Checking out valgrind source tree ... failed ! Last 20 lines of verbose log follow echo + Checking out valgrind source tree ... svn co svn://svn.valgrind.org/valgrind/trunk -r {2007-10-15T03:00:03} valgrind + svn: Can't connect to host 'svn.valgrind.org': Connection timed out |
|
From: <js...@ac...> - 2007-10-15 00:17:53
|
Nightly build on g5 ( SuSE 10.1, ppc970 ) started at 2007-10-15 02:00:01 CEST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 228 tests, 6 stderr failures, 2 stdout failures, 0 posttest failures == memcheck/tests/deep_templates (stdout) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_cmsg (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) |