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
(13) |
2
(15) |
|
3
(16) |
4
(42) |
5
(9) |
6
(20) |
7
(22) |
8
(24) |
9
(12) |
|
10
(24) |
11
(11) |
12
(2) |
13
(13) |
14
(8) |
15
|
16
(16) |
|
17
(24) |
18
(36) |
19
(100) |
20
(94) |
21
(50) |
22
(39) |
23
(10) |
|
24
(14) |
25
(19) |
26
(2) |
27
(6) |
28
(17) |
29
(9) |
30
(8) |
|
31
(21) |
|
|
|
|
|
|
|
From: <sv...@va...> - 2009-05-24 23:43:34
|
Author: njn
Date: 2009-05-25 00:43:30 +0100 (Mon, 25 May 2009)
New Revision: 10137
Log:
Trunk sync: revert DiSym layout, but add a comment about it.
Modified:
branches/DARWIN/coregrind/m_debuginfo/priv_storage.h
Modified: branches/DARWIN/coregrind/m_debuginfo/priv_storage.h
===================================================================
--- branches/DARWIN/coregrind/m_debuginfo/priv_storage.h 2009-05-24 23:36:50 UTC (rev 10136)
+++ branches/DARWIN/coregrind/m_debuginfo/priv_storage.h 2009-05-24 23:43:30 UTC (rev 10137)
@@ -51,8 +51,12 @@
Addr addr; /* lowest address of entity */
Addr tocptr; /* ppc64-linux only: value that R2 should have */
UChar *name; /* name */
- UInt size:31; /* size in bytes */
- UInt isText:1;
+ // XXX: this could be shrunk (on 32-bit platforms) by using 31 bits for
+ // the size and 1 bit for the isText. If you do this, make sure that
+ // all assignments to isText use 0 or 1 (or True or False), and that a
+ // positive number larger than 1 is never used to represent True.
+ UInt size; /* size in bytes */
+ Bool isText;
}
DiSym;
|
|
From: <sv...@va...> - 2009-05-24 23:36:58
|
Author: njn
Date: 2009-05-25 00:36:50 +0100 (Mon, 25 May 2009)
New Revision: 10136
Log:
Changing VG_MALLOC_MIN_SZB to 16 on some platforms broke heap profiling.
This fixes it by changing the size of a cost centre from ULong to
VG_MALLOC_MIN_SZB.
Modified:
trunk/coregrind/m_mallocfree.c
Modified: trunk/coregrind/m_mallocfree.c
===================================================================
--- trunk/coregrind/m_mallocfree.c 2009-05-24 23:06:36 UTC (rev 10135)
+++ trunk/coregrind/m_mallocfree.c 2009-05-24 23:36:50 UTC (rev 10136)
@@ -70,7 +70,7 @@
/* Layout of an in-use block:
- cost center (OPTIONAL) (sizeof(ULong) bytes, only when h-p enabled)
+ cost center (OPTIONAL) (VG_MIN_MALLOC_SZB bytes, only when h-p enabled)
this block total szB (sizeof(SizeT) bytes)
red zone bytes (depends on Arena.rz_szB, but >= sizeof(void*))
(payload bytes)
@@ -79,7 +79,7 @@
Layout of a block on the free list:
- cost center (OPTIONAL) (sizeof(ULong) bytes, only when h-p enabled)
+ cost center (OPTIONAL) (VG_MIN_MALLOC_SZB bytes, only when h-p enabled)
this block total szB (sizeof(SizeT) bytes)
freelist previous ptr (sizeof(void*) bytes)
excess red zone bytes (if Arena.rz_szB > sizeof(void*))
@@ -95,7 +95,7 @@
when heap profiling is not enabled, and
- bszB == pszB + 2*sizeof(SizeT) + 2*a->rz_szB + sizeof(ULong)
+ bszB == pszB + 2*sizeof(SizeT) + 2*a->rz_szB + VG_MIN_MALLOC_SZB
when it is enabled. It follows that the minimum overhead per heap
block for arenas used by the core is:
@@ -105,8 +105,8 @@
when heap profiling is not enabled, and
- 32-bit platforms: 2*4 + 2*4 + 8 == 24 bytes
- 64-bit platforms: 2*8 + 2*8 + 8 == 40 bytes
+ 32-bit platforms: 2*4 + 2*4 + 8 == 24 bytes
+ 64-bit platforms: 2*8 + 2*8 + 16 == 48 bytes
when it is enabled. In all cases, extra overhead may be incurred
when rounding the payload size up to VG_MIN_MALLOC_SZB.
@@ -231,7 +231,7 @@
static __inline__
SizeT hp_overhead_szB ( void )
{
- return VG_(clo_profile_heap) ? sizeof(ULong) : 0;
+ return VG_(clo_profile_heap) ? VG_MIN_MALLOC_SZB : 0;
}
//---------------------------------------------------------------------------
@@ -472,9 +472,7 @@
// redzone size if necessary to achieve this.
a->rz_szB = rz_szB;
while (0 != overhead_szB_lo(a) % VG_MIN_MALLOC_SZB) a->rz_szB++;
- // vg_assert(overhead_szB_lo(a) == overhead_szB_hi(a));
- vg_assert(0 == overhead_szB_lo(a) % VG_MIN_MALLOC_SZB);
- vg_assert(0 == overhead_szB_hi(a) % VG_MIN_MALLOC_SZB);
+ vg_assert(overhead_szB_lo(a) - hp_overhead_szB() == overhead_szB_hi(a));
a->min_sblock_szB = min_sblock_szB;
for (i = 0; i < N_MALLOC_LISTS; i++) a->freelist[i] = NULL;
|
|
From: <sv...@va...> - 2009-05-24 23:06:40
|
Author: njn
Date: 2009-05-25 00:06:36 +0100 (Mon, 25 May 2009)
New Revision: 10135
Log:
Trunk sync: reinstate a check on Linux.
Modified:
branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c
===================================================================
--- branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-05-24 23:02:55 UTC (rev 10134)
+++ branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-05-24 23:06:36 UTC (rev 10135)
@@ -2395,6 +2395,16 @@
if (sr_isError(sres))
return sres;
+#if defined(VGO_linux)
+ if (sr_Res(sres) != advised) {
+ /* I don't think this can happen. It means the kernel made a
+ fixed map succeed but not at the requested location. Try to
+ repair the damage, then return saying the mapping failed. */
+ (void)ML_(am_do_munmap_NO_NOTIFY)( sr_Res(sres), length );
+ return VG_(mk_SysRes_Error)( VKI_EINVAL );
+ }
+#endif
+
/* Ok, the mapping succeeded. Now notify the interval map. */
init_nsegment( &seg );
seg.kind = SkAnonV;
|
|
From: <sv...@va...> - 2009-05-24 23:02:59
|
Author: njn
Date: 2009-05-25 00:02:55 +0100 (Mon, 25 May 2009)
New Revision: 10134
Log:
DARWIN sync: sys_truncate64 and sys_ftruncate64 wrappers.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2009-05-24 22:45:33 UTC (rev 10133)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2009-05-24 23:02:55 UTC (rev 10134)
@@ -2001,8 +2001,11 @@
#define PRE(name) DEFN_PRE_TEMPLATE(generic, name)
#define POST(name) DEFN_POST_TEMPLATE(generic, name)
+#if VG_WORDSIZE == 4
// Combine two 32-bit values into a 64-bit value
+// Always use with low-numbered arg first (e.g. LOHI64(ARG1,ARG2) )
#define LOHI64(lo,hi) ( ((ULong)(lo)) | (((ULong)(hi)) << 32) )
+#endif
PRE(sys_exit)
{
@@ -2853,30 +2856,36 @@
PRE_MEM_RASCIIZ( "truncate(path)", ARG1 );
}
-// XXX: this wrapper is only suitable for 32-bit platforms
-#if defined(VGP_x86_linux) || defined(VGP_ppc32_linux)
PRE(sys_ftruncate64)
{
*flags |= SfMayBlock;
+#if VG_WORDSIZE == 4
PRINT("sys_ftruncate64 ( %ld, %lld )", ARG1, LOHI64(ARG2,ARG3));
PRE_REG_READ3(long, "ftruncate64",
unsigned int, fd,
- vki_u32, length_low32, vki_u32, length_high32);
+ UWord, length_low32, UWord, length_high32);
+#else
+ PRINT("sys_ftruncate64 ( %ld, %lld )", ARG1, (Long)ARG2);
+ PRE_REG_READ2(long, "ftruncate64",
+ unsigned int,fd, UWord,length);
+#endif
}
-#endif
-// XXX: this wrapper is only suitable for 32-bit platforms
-#if defined(VGP_x86_linux) || defined(VGP_ppc32_linux)
PRE(sys_truncate64)
{
*flags |= SfMayBlock;
- PRINT("sys_truncate64 ( %#lx, %lld )", ARG1, LOHI64(ARG2, ARG3));
+#if VG_WORDSIZE == 4
+ PRINT("sys_truncate64 ( %#lx, %lld )", ARG1, (Long)LOHI64(ARG2, ARG3));
PRE_REG_READ3(long, "truncate64",
const char *, path,
- vki_u32, length_low32, vki_u32, length_high32);
+ UWord, length_low32, UWord, length_high32);
+#else
+ PRINT("sys_truncate64 ( %#lx, %lld )", ARG1, (Long)ARG2);
+ PRE_REG_READ2(long, "truncate64",
+ const char *,path, UWord,length);
+#endif
PRE_MEM_RASCIIZ( "truncate64(path)", ARG1 );
}
-#endif
PRE(sys_getdents)
{
@@ -3006,7 +3015,7 @@
case VKI_RLIMIT_STACK:
*((struct vki_rlimit *)a2) = VG_(client_rlimit_stack);
break;
- }
+ }
}
PRE(sys_old_getrlimit)
|
|
From: <sv...@va...> - 2009-05-24 22:45:40
|
Author: njn
Date: 2009-05-24 23:45:33 +0100 (Sun, 24 May 2009)
New Revision: 10133
Log:
DARWIN sync: remove redundant check (it's done again in pre_mem_sock_addr()).
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2009-05-24 22:32:45 UTC (rev 10132)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2009-05-24 22:45:33 UTC (rev 10133)
@@ -1406,9 +1406,6 @@
{
/* int connect(int sockfd,
struct sockaddr *serv_addr, int addrlen ); */
- PRE_MEM_READ( "socketcall.connect(serv_addr.sa_family)",
- arg1, /* serv_addr */
- sizeof(vki_sa_family_t));
pre_mem_read_sockaddr( tid,
"socketcall.connect(serv_addr.%s)",
(struct vki_sockaddr *) arg1, arg2);
|
|
From: <sv...@va...> - 2009-05-24 22:33:01
|
Author: njn
Date: 2009-05-24 23:32:45 +0100 (Sun, 24 May 2009)
New Revision: 10132
Log:
Trunk sync: sys_open wrapper.
Modified:
branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
Modified: branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-05-24 22:32:33 UTC (rev 10131)
+++ branches/DARWIN/coregrind/m_syswrap/syswrap-generic.c 2009-05-24 22:32:45 UTC (rev 10132)
@@ -3531,22 +3531,24 @@
cloned fd back to the start. */
{
HChar name[30];
+ Char* arg1s = (Char*) ARG1;
SysRes sres;
- VG_(sprintf)(name, "/proc/%d/cmdline", VG_(getpid)());
- if (ML_(safe_to_deref)( (void*)ARG1, 1 )
- && (VG_(strcmp)((Char *)ARG1, name) == 0
- || VG_(strcmp)((Char *)ARG1, "/proc/self/cmdline") == 0)) {
- sres = VG_(dup)( VG_(cl_cmdline_fd) );
- SET_STATUS_from_SysRes( sres );
- if (!sr_isError(sres)) {
- OffT off = VG_(lseek)( sr_Res(sres), 0, VKI_SEEK_SET );
- if (off < 0)
- SET_STATUS_Failure( VKI_EMFILE );
+ VG_(sprintf)(name, "/proc/%d/cmdline", VG_(getpid)());
+ if (ML_(safe_to_deref)( arg1s, 1 ) &&
+ (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, "/proc/self/cmdline"))
+ )
+ {
+ sres = VG_(dup)( VG_(cl_cmdline_fd) );
+ SET_STATUS_from_SysRes( sres );
+ if (!sr_isError(sres)) {
+ OffT off = VG_(lseek)( sr_Res(sres), 0, VKI_SEEK_SET );
+ if (off < 0)
+ SET_STATUS_Failure( VKI_EMFILE );
+ }
+ return;
}
- return;
}
- }
#endif
/* Otherwise handle normally */
|
|
From: <sv...@va...> - 2009-05-24 22:32:46
|
Author: njn
Date: 2009-05-24 23:32:33 +0100 (Sun, 24 May 2009)
New Revision: 10131
Log:
DARWIN sync: sys_open wrapper.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2009-05-24 18:10:41 UTC (rev 10130)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2009-05-24 22:32:33 UTC (rev 10131)
@@ -3393,9 +3393,6 @@
PRE(sys_open)
{
- HChar name[30];
- SysRes sres;
-
if (ARG2 & VKI_O_CREAT) {
// 3-arg version
PRINT("sys_open ( %#lx(%s), %ld, %ld )",ARG1,(char*)ARG1,ARG2,ARG3);
@@ -3413,19 +3410,25 @@
/proc/<pid>/cmdline, and just give it a copy of the fd for the
fake file we cooked up at startup (in m_main). Also, seek the
cloned fd back to the start. */
+ {
+ HChar name[30];
+ Char* arg1s = (Char*) ARG1;
+ SysRes sres;
- VG_(sprintf)(name, "/proc/%d/cmdline", VG_(getpid)());
- if (ML_(safe_to_deref)( (void*)ARG1, 1 )
- && (VG_(strcmp)((Char *)ARG1, name) == 0
- || VG_(strcmp)((Char *)ARG1, "/proc/self/cmdline") == 0)) {
- sres = VG_(dup)( VG_(cl_cmdline_fd) );
- SET_STATUS_from_SysRes( sres );
- if (!sr_isError(sres)) {
- OffT off = VG_(lseek)( sr_Res(sres), 0, VKI_SEEK_SET );
- if (off < 0)
- SET_STATUS_Failure( VKI_EMFILE );
+ VG_(sprintf)(name, "/proc/%d/cmdline", VG_(getpid)());
+ if (ML_(safe_to_deref)( arg1s, 1 ) &&
+ (VG_STREQ(arg1s, name) || VG_STREQ(arg1s, "/proc/self/cmdline"))
+ )
+ {
+ sres = VG_(dup)( VG_(cl_cmdline_fd) );
+ SET_STATUS_from_SysRes( sres );
+ if (!sr_isError(sres)) {
+ OffT off = VG_(lseek)( sr_Res(sres), 0, VKI_SEEK_SET );
+ if (off < 0)
+ SET_STATUS_Failure( VKI_EMFILE );
+ }
+ return;
}
- return;
}
/* Otherwise handle normally */
|
|
From: <sv...@va...> - 2009-05-24 18:10:53
|
Author: bart
Date: 2009-05-24 19:10:41 +0100 (Sun, 24 May 2009)
New Revision: 10130
Log:
Implemented a block allocator for DRD's second-level bitmap nodes.
Modified:
branches/DRDDEV/coregrind/m_oset.c
branches/DRDDEV/drd/drd_bitmap2_node.c
branches/DRDDEV/memcheck/tests/unit_oset.c
Modified: branches/DRDDEV/coregrind/m_oset.c
===================================================================
--- branches/DRDDEV/coregrind/m_oset.c 2009-05-24 07:53:33 UTC (rev 10129)
+++ branches/DRDDEV/coregrind/m_oset.c 2009-05-24 18:10:41 UTC (rev 10130)
@@ -80,6 +80,7 @@
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_oset.h"
+#include "pub_tool_mallocfree.h" /* VG_(malloc), VG_(free) */
/*--------------------------------------------------------------------*/
/*--- Types and constants ---*/
@@ -296,7 +297,7 @@
vg_assert(_free);
if (!_cmp) vg_assert(0 == _keyOff); // If no cmp, offset must be zero
- t = _alloc(_cc, sizeof(AvlTree));
+ t = VG_(malloc)("oset", sizeof(AvlTree));
t->keyOff = _keyOff;
t->cmp = _cmp;
t->alloc = _alloc;
@@ -348,7 +349,7 @@
vg_assert(sz == t->nElems);
/* Free the AvlTree itself. */
- t->free(t);
+ VG_(free)(t);
}
void VG_(OSetWord_Destroy)(AvlTree* t)
Modified: branches/DRDDEV/drd/drd_bitmap2_node.c
===================================================================
--- branches/DRDDEV/drd/drd_bitmap2_node.c 2009-05-24 07:53:33 UTC (rev 10129)
+++ branches/DRDDEV/drd/drd_bitmap2_node.c 2009-05-24 18:10:41 UTC (rev 10130)
@@ -22,30 +22,145 @@
The GNU General Public License is contained in the file COPYING.
*/
+/*
+ * Block allocator for second-level bitmap nodes. Each node consists of
+ * an OSetGen node and a struct bitmap2. The code below allocates
+ * NODES_PER_CHUNK nodes at a time.
+ */
+
#include "drd_basics.h" /* DRD_() */
#include "pub_drd_bitmap.h"
#include "pub_tool_basics.h" /* Addr, SizeT */
#include "pub_tool_libcassert.h" /* tl_assert() */
+#include "pub_tool_libcbase.h" /* VG_ROUNDUP() */
+#include "pub_tool_libcprint.h" /* VG_(message)() */
#include "pub_tool_mallocfree.h" /* VG_(malloc), VG_(free) */
-/* Local function declarations. */
+#define NODES_PER_CHUNCK 512
+/* Local type definitions. */
+struct block_allocator_chunk {
+ struct block_allocator_chunk* next;
+ struct block_allocator_chunk* prev;
+ int nallocated;
+ void* data;
+ void* data_end;
+ void* first_free;
+};
+
+
/* Local variables. */
+static SizeT s_bm2_node_size;
+static struct block_allocator_chunk* s_first;
/* Function definitions. */
+/**
+ * Allocate a new chunk and insert it at the start of the doubly-linked list
+ * s_first.
+ */
+static struct block_allocator_chunk* allocate_new_chunk(void)
+{
+ struct block_allocator_chunk* p;
+ int i;
+
+ tl_assert(s_bm2_node_size > 0);
+
+ p = VG_(malloc)("drd.bitmap.bac",
+ sizeof(*p) + NODES_PER_CHUNCK * s_bm2_node_size);
+ tl_assert(p);
+ p->next = s_first;
+ if (s_first)
+ p->next->prev = p;
+ s_first = p;
+ p->prev = 0;
+ p->nallocated = 0;
+ p->data = (char*)p + sizeof(*p);
+ tl_assert(p->data);
+ p->data_end = (char*)(p->data) + NODES_PER_CHUNCK * s_bm2_node_size;
+ p->first_free = p->data;
+ for (i = 0; i < NODES_PER_CHUNCK - 1; i++)
+ {
+ *(void**)((char*)(p->data) + i * s_bm2_node_size)
+ = (char*)(p->data) + (i + 1) * s_bm2_node_size;
+ }
+ tl_assert(i == NODES_PER_CHUNCK - 1);
+ *(void**)((char*)(p->data) + i * s_bm2_node_size) = NULL;
+
+ return p;
+}
+
+/** Free a chunk and remove it from the list of chunks. */
+static void free_chunk(struct block_allocator_chunk* const p)
+{
+ tl_assert(p);
+ tl_assert(p->nallocated == 0);
+
+ if (p == s_first)
+ s_first = p->next;
+ else if (p->prev)
+ p->prev->next = p->next;
+ if (p->next)
+ p->next->prev = p->prev;
+ VG_(free)(p);
+}
+
+/** Allocate a node. */
void* DRD_(bm2_alloc_node)(HChar* const ec, const SizeT szB)
{
- return VG_(malloc)(ec, szB);
+ while (True)
+ {
+ struct block_allocator_chunk* p;
+
+ if (s_bm2_node_size == 0)
+ s_bm2_node_size = szB;
+ else
+ tl_assert(s_bm2_node_size == szB);
+
+ for (p = s_first; p; p = p->next)
+ {
+ if (p->first_free)
+ {
+ void* result;
+
+ p->nallocated++;
+ result = p->first_free;
+ p->first_free = *(void**)(p->first_free);
+ return result;
+ }
+ }
+
+ allocate_new_chunk();
+ }
}
+/** Free a node. */
void DRD_(bm2_free_node)(void* const bm2)
{
- return VG_(free)(bm2);
+ struct block_allocator_chunk* p;
+
+ tl_assert(s_bm2_node_size > 0);
+ tl_assert(bm2);
+
+ for (p = s_first; p; p = p->next)
+ {
+ if (p->data <= bm2 && bm2 < p->data_end)
+ {
+ tl_assert(((char*)bm2 - (char*)(p->data)) % s_bm2_node_size == 0);
+ *(void**)bm2 = p->first_free;
+ p->first_free = bm2;
+ tl_assert(p->nallocated >= 1);
+ if (--(p->nallocated) == 0)
+ free_chunk(p);
+ return;
+ }
+ }
+
+ tl_assert(False);
}
Modified: branches/DRDDEV/memcheck/tests/unit_oset.c
===================================================================
--- branches/DRDDEV/memcheck/tests/unit_oset.c 2009-05-24 07:53:33 UTC (rev 10129)
+++ branches/DRDDEV/memcheck/tests/unit_oset.c 2009-05-24 18:10:41 UTC (rev 10130)
@@ -28,6 +28,11 @@
#define vgPlain_memset memset
#define vgPlain_memcpy memcpy
+void* VG_(malloc)(HChar* cc, SizeT nbytes)
+{ return malloc(nbytes); }
+void VG_(free)(void* p)
+{ return free(p); }
+
#include "coregrind/m_oset.c"
#define NN 1000 // Size of OSets being created
|
|
From: <sv...@va...> - 2009-05-24 07:53:39
|
Author: bart
Date: 2009-05-24 08:53:33 +0100 (Sun, 24 May 2009)
New Revision: 10129
Log:
Moved allocation of level-two bitmaps to a separate source file.
Added:
branches/DRDDEV/drd/drd_bitmap2_node.c
Modified:
branches/DRDDEV/drd/Makefile.am
branches/DRDDEV/drd/drd_bitmap.c
branches/DRDDEV/drd/pub_drd_bitmap.h
branches/DRDDEV/drd/tests/drd_bitmap_test.c
Modified: branches/DRDDEV/drd/Makefile.am
===================================================================
--- branches/DRDDEV/drd/Makefile.am 2009-05-24 07:33:38 UTC (rev 10128)
+++ branches/DRDDEV/drd/Makefile.am 2009-05-24 07:53:33 UTC (rev 10129)
@@ -94,6 +94,7 @@
DRD_SOURCES = \
drd_barrier.c \
+ drd_bitmap2_node.c \
drd_clientobj.c \
drd_clientreq.c \
drd_cond.c \
Modified: branches/DRDDEV/drd/drd_bitmap.c
===================================================================
--- branches/DRDDEV/drd/drd_bitmap.c 2009-05-24 07:33:38 UTC (rev 10128)
+++ branches/DRDDEV/drd/drd_bitmap.c 2009-05-24 07:53:33 UTC (rev 10129)
@@ -73,8 +73,8 @@
bm->cache[i].a1 = ~(UWord)1;
bm->cache[i].bm2 = 0;
}
- bm->oset = VG_(OSetGen_Create)(0, 0, VG_(malloc), "drd.bitmap.bn.2",
- VG_(free));
+ bm->oset = VG_(OSetGen_Create)(0, 0, DRD_(bm2_alloc_node),
+ "drd.bitmap.bn.2", DRD_(bm2_free_node));
s_bitmap_creation_count++;
Added: branches/DRDDEV/drd/drd_bitmap2_node.c
===================================================================
--- branches/DRDDEV/drd/drd_bitmap2_node.c (rev 0)
+++ branches/DRDDEV/drd/drd_bitmap2_node.c 2009-05-24 07:53:33 UTC (rev 10129)
@@ -0,0 +1,51 @@
+/* -*- mode: C; c-basic-offset: 3; -*- */
+/*
+ This file is part of drd, a thread error detector.
+
+ Copyright (C) 2006-2009 Bart Van Assche <bar...@gm...>.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+
+#include "drd_basics.h" /* DRD_() */
+#include "pub_drd_bitmap.h"
+#include "pub_tool_basics.h" /* Addr, SizeT */
+#include "pub_tool_libcassert.h" /* tl_assert() */
+#include "pub_tool_mallocfree.h" /* VG_(malloc), VG_(free) */
+
+
+/* Local function declarations. */
+
+
+
+/* Local variables. */
+
+
+
+/* Function definitions. */
+
+void* DRD_(bm2_alloc_node)(HChar* const ec, const SizeT szB)
+{
+ return VG_(malloc)(ec, szB);
+}
+
+void DRD_(bm2_free_node)(void* const bm2)
+{
+ return VG_(free)(bm2);
+}
Modified: branches/DRDDEV/drd/pub_drd_bitmap.h
===================================================================
--- branches/DRDDEV/drd/pub_drd_bitmap.h 2009-05-24 07:33:38 UTC (rev 10128)
+++ branches/DRDDEV/drd/pub_drd_bitmap.h 2009-05-24 07:53:33 UTC (rev 10129)
@@ -125,4 +125,7 @@
ULong DRD_(bm_get_bitmap2_creation_count)(void);
ULong DRD_(bm_get_bitmap2_merge_count)(void);
+void* DRD_(bm2_alloc_node)(HChar* const ec, const SizeT szB);
+void DRD_(bm2_free_node)(void* const bm2);
+
#endif /* __PUB_DRD_BITMAP_H */
Modified: branches/DRDDEV/drd/tests/drd_bitmap_test.c
===================================================================
--- branches/DRDDEV/drd/tests/drd_bitmap_test.c 2009-05-24 07:33:38 UTC (rev 10128)
+++ branches/DRDDEV/drd/tests/drd_bitmap_test.c 2009-05-24 07:53:33 UTC (rev 10129)
@@ -5,6 +5,7 @@
#include <unistd.h>
#include "coregrind/m_oset.c"
#include "drd/drd_bitmap.c"
+#include "drd/drd_bitmap2_node.c"
#include "drd/pub_drd_bitmap.h"
|
|
From: <sv...@va...> - 2009-05-24 07:33:45
|
Author: bart
Date: 2009-05-24 08:33:38 +0100 (Sun, 24 May 2009)
New Revision: 10128
Log:
Comment-only changes.
Modified:
branches/DRDDEV/drd/drd_bitmap.h
Modified: branches/DRDDEV/drd/drd_bitmap.h
===================================================================
--- branches/DRDDEV/drd/drd_bitmap.h 2009-05-24 07:20:24 UTC (rev 10127)
+++ branches/DRDDEV/drd/drd_bitmap.h 2009-05-24 07:33:38 UTC (rev 10128)
@@ -57,20 +57,23 @@
#define ADDR_IGNORED_MASK ((1U << ADDR_IGNORED_BITS) - 1U)
#define ADDR_GRANULARITY (1U << ADDR_IGNORED_BITS)
-/** Round argument a up to a multiple of (1 << ADDR_GRANULARITY), and next
- * shift it right ADDR_GRANULARITY bits. The expression below is optimized
- * for the case where a is a constant.
+/**
+ * Round argument a up to a multiple of (1 << ADDR_GRANULARITY), and next
+ * shift it right ADDR_GRANULARITY bits. The expression below is optimized
+ * for the case where a is a constant.
*/
#define SCALED_SIZE(a) \
(((((a) - 1U) | ADDR_IGNORED_MASK) + 1U) >> ADDR_IGNORED_BITS)
-/** Number of bits assigned to the least significant component of an address.
+/**
+ * Number of bits assigned to the least significant component of an address.
*/
#define ADDR_LSB_BITS 12
-/** Mask that has to be applied to an address of type Addr in order to
- * compute the least significant part of an address split, after having
- * shifted the address bits ADDR_GRANULARITY to the right.
+/**
+ * Mask that has to be applied to an address of type Addr in order to
+ * compute the least significant part of an address split, after having
+ * shifted the address bits ADDR_GRANULARITY to the right.
*/
#define ADDR_LSB_MASK (((UWord)1 << ADDR_LSB_BITS) - 1U)
@@ -111,9 +114,10 @@
+ 1U);
}
-/** Convert LSB and MSB back into an address.
+/**
+ * Convert LSB and MSB back into an address.
*
- * @note It is assumed that sizeof(Addr) == sizeof(UWord).
+ * @note It is assumed that sizeof(Addr) == sizeof(UWord).
*/
static __inline__
Addr make_address(const UWord a1, const UWord a0)
@@ -126,10 +130,10 @@
-/* Number of bits that fit in a variable of type UWord. */
+/** Number of bits that fit in a variable of type UWord. */
#define BITS_PER_UWORD (8U * sizeof(UWord))
-/* Log2 of BITS_PER_UWORD. */
+/** Log2 of BITS_PER_UWORD. */
#if defined(VGA_x86) || defined(VGA_ppc32)
#define BITS_PER_BITS_PER_UWORD 5
#elif defined(VGA_amd64) || defined(VGA_ppc64)
@@ -138,18 +142,19 @@
#error Unknown platform.
#endif
-/** Number of UWord's needed to store one bit per address LSB.
- */
+/** Number of UWord's needed to store one bit per address LSB. */
#define BITMAP1_UWORD_COUNT (1U << (ADDR_LSB_BITS - BITS_PER_BITS_PER_UWORD))
-/** Mask that has to be applied to an (Addr >> ADDR_IGNORED_BITS) expression
- * in order to compute the least significant part of an UWord.
+/**
+ * Mask that has to be applied to an (Addr >> ADDR_IGNORED_BITS) expression
+ * in order to compute the least significant part of an UWord.
*/
#define UWORD_LSB_MASK (((UWord)1 << BITS_PER_BITS_PER_UWORD) - 1)
-/** Compute index into bm0[] array.
+/**
+ * Compute index into bm0[] array.
*
- * @param a Address shifted right ADDR_IGNORED_BITS bits.
+ * @param a Address shifted right ADDR_IGNORED_BITS bits.
*/
static __inline__
UWord uword_msb(const UWord a)
@@ -160,9 +165,10 @@
return a >> BITS_PER_BITS_PER_UWORD;
}
-/** Return the least significant bits.
+/**
+ * Return the least significant bits.
*
- * @param a Address shifted right ADDR_IGNORED_BITS bits.
+ * @param a Address shifted right ADDR_IGNORED_BITS bits.
*/
static __inline__
UWord uword_lsb(const UWord a)
@@ -173,10 +179,11 @@
return a & UWORD_LSB_MASK;
}
-/** Compute the highest address lower than a for which
- * uword_lsb(address_lsb(a)) == 0.
+/**
+ * Compute the highest address lower than a for which
+ * uword_lsb(address_lsb(a)) == 0.
*
- * @param a Address.
+ * @param a Address.
*/
static __inline__
Addr first_address_with_same_uword_lsb(const Addr a)
@@ -347,8 +354,9 @@
-/** Rotate elements cache[0..n-1] such that the element at position n-1 is
- * moved to position 0. This allows to speed up future cache lookups.
+/**
+ * Rotate elements cache[0..n-1] such that the element at position n-1 is
+ * moved to position 0. This allows to speed up future cache lookups.
*/
static __inline__
void bm_cache_rotate(struct bm_cache_elem cache[], const int n)
@@ -492,12 +500,13 @@
bm->cache[0].bm2 = bm2;
}
-/** Look up the address a1 in bitmap bm and return a pointer to a potentially
- * shared second level bitmap. The bitmap where the returned pointer points
- * at may not be modified by the caller.
+/**
+ * Look up the address a1 in bitmap bm and return a pointer to a potentially
+ * shared second level bitmap. The bitmap where the returned pointer points
+ * at may not be modified by the caller.
*
- * @param a1 client address shifted right by ADDR_LSB_BITS.
- * @param bm bitmap pointer.
+ * @param a1 client address shifted right by ADDR_LSB_BITS.
+ * @param bm bitmap pointer.
*/
static __inline__
const struct bitmap2* bm2_lookup(struct bitmap* const bm, const UWord a1)
@@ -516,11 +525,12 @@
return bm2;
}
-/** Look up the address a1 in bitmap bm and return a pointer to a second
- * level bitmap that is not shared and hence may be modified.
+/**
+ * Look up the address a1 in bitmap bm and return a pointer to a second
+ * level bitmap that is not shared and hence may be modified.
*
- * @param a1 client address shifted right by ADDR_LSB_BITS.
- * @param bm bitmap pointer.
+ * @param a1 client address shifted right by ADDR_LSB_BITS.
+ * @param bm bitmap pointer.
*/
static __inline__
struct bitmap2*
@@ -540,10 +550,11 @@
return bm2;
}
-/** Insert an uninitialized second level bitmap for the address a1.
+/**
+ * Insert an uninitialized second level bitmap for the address a1.
*
- * @param bm bitmap pointer.
- * @param a1 client address shifted right by ADDR_LSB_BITS.
+ * @param bm bitmap pointer.
+ * @param a1 client address shifted right by ADDR_LSB_BITS.
*/
static __inline__
struct bitmap2* bm2_insert(struct bitmap* const bm, const UWord a1)
@@ -576,11 +587,12 @@
return bm2_copy;
}
-/** Look up the address a1 in bitmap bm, and insert it if not found.
- * The returned second level bitmap may not be modified.
+/**
+ * Look up the address a1 in bitmap bm, and insert it if not found.
+ * The returned second level bitmap may not be modified.
*
- * @param a1 client address shifted right by ADDR_LSB_BITS.
- * @param bm bitmap pointer.
+ * @param a1 client address shifted right by ADDR_LSB_BITS.
+ * @param bm bitmap pointer.
*/
static __inline__
struct bitmap2* bm2_lookup_or_insert(struct bitmap* const bm, const UWord a1)
@@ -612,11 +624,12 @@
return bm2;
}
-/** Look up the address a1 in bitmap bm, and insert it if not found.
- * The returned second level bitmap may be modified.
+/**
+ * Look up the address a1 in bitmap bm, and insert it if not found.
+ * The returned second level bitmap may be modified.
*
- * @param a1 client address shifted right by ADDR_LSB_BITS.
- * @param bm bitmap pointer.
+ * @param a1 client address shifted right by ADDR_LSB_BITS.
+ * @param bm bitmap pointer.
*/
static __inline__
struct bitmap2* bm2_lookup_or_insert_exclusive(struct bitmap* const bm,
|
|
From: <sv...@va...> - 2009-05-24 07:20:32
|
Author: bart
Date: 2009-05-24 08:20:24 +0100 (Sun, 24 May 2009)
New Revision: 10127
Log:
Swapped the order of segment creation and vector clock combining.
Modified:
branches/DRDDEV/drd/drd_barrier.c
branches/DRDDEV/drd/drd_mutex.c
branches/DRDDEV/drd/drd_rwlock.c
branches/DRDDEV/drd/drd_semaphore.c
Modified: branches/DRDDEV/drd/drd_barrier.c
===================================================================
--- branches/DRDDEV/drd/drd_barrier.c 2009-05-24 07:18:36 UTC (rev 10126)
+++ branches/DRDDEV/drd/drd_barrier.c 2009-05-24 07:20:24 UTC (rev 10127)
@@ -456,6 +456,12 @@
VG_(OSetGen_Insert)(p->oset, q);
tl_assert(VG_(OSetGen_Lookup)(p->oset, &word_tid) == q);
}
+
+ /* Create a new segment and store a pointer to that segment. */
+ DRD_(thread_new_segment)(tid);
+ DRD_(thread_get_latest_segment)(&q->post_wait_sg, tid);
+ s_barrier_segment_creation_count++;
+
/*
* Combine all vector clocks that were stored in the pre_barrier_wait
* wrapper with the vector clock of the current thread.
@@ -478,11 +484,6 @@
DRD_(vc_cleanup)(&old_vc);
}
- /* Create a new segment and store a pointer to that segment. */
- DRD_(thread_new_segment)(tid);
- DRD_(thread_get_latest_segment)(&q->post_wait_sg, tid);
- s_barrier_segment_creation_count++;
-
/*
* If the same number of threads as the barrier count indicates have
* called the post *_barrier_wait() wrapper, toggle p->post_iteration and
Modified: branches/DRDDEV/drd/drd_mutex.c
===================================================================
--- branches/DRDDEV/drd/drd_mutex.c 2009-05-24 07:18:36 UTC (rev 10126)
+++ branches/DRDDEV/drd/drd_mutex.c 2009-05-24 07:20:24 UTC (rev 10127)
@@ -305,13 +305,14 @@
{
const DrdThreadId last_owner = p->owner;
+ DRD_(thread_new_segment)(drd_tid);
+ s_mutex_segment_creation_count++;
+
if (last_owner != drd_tid && last_owner != DRD_INVALID_THREADID)
{
tl_assert(p->last_locked_segment);
DRD_(thread_combine_vc_sync)(drd_tid, p->last_locked_segment);
}
- DRD_(thread_new_segment)(drd_tid);
- s_mutex_segment_creation_count++;
p->owner = drd_tid;
p->acquiry_time_ms = VG_(read_millisecond_timer)();
Modified: branches/DRDDEV/drd/drd_rwlock.c
===================================================================
--- branches/DRDDEV/drd/drd_rwlock.c 2009-05-24 07:18:36 UTC (rev 10126)
+++ branches/DRDDEV/drd/drd_rwlock.c 2009-05-24 07:20:24 UTC (rev 10127)
@@ -385,11 +385,12 @@
q = DRD_(lookup_or_insert_node)(p->thread_info, drd_tid);
if (++q->reader_nesting_count == 1)
{
- DRD_(rwlock_combine_other_vc)(p, drd_tid, False);
- q->last_lock_was_writer_lock = False;
DRD_(thread_new_segment)(drd_tid);
DRD_(s_rwlock_segment_creation_count)++;
+ DRD_(rwlock_combine_other_vc)(p, drd_tid, False);
+ q->last_lock_was_writer_lock = False;
+
p->acquiry_time_ms = VG_(read_millisecond_timer)();
p->acquired_at = VG_(record_ExeContext)(VG_(get_running_tid)(), 0);
}
Modified: branches/DRDDEV/drd/drd_semaphore.c
===================================================================
--- branches/DRDDEV/drd/drd_semaphore.c 2009-05-24 07:18:36 UTC (rev 10126)
+++ branches/DRDDEV/drd/drd_semaphore.c 2009-05-24 07:20:24 UTC (rev 10127)
@@ -299,14 +299,15 @@
tl_assert(sg);
if (sg)
{
+ DRD_(thread_new_segment)(tid);
+ s_semaphore_segment_creation_count++;
+
if (p->last_sem_post_tid != tid
&& p->last_sem_post_tid != DRD_INVALID_THREADID)
{
DRD_(thread_combine_vc_sync)(tid, sg);
}
DRD_(sg_put)(sg);
- DRD_(thread_new_segment)(tid);
- s_semaphore_segment_creation_count++;
}
}
}
|
|
From: <sv...@va...> - 2009-05-24 07:18:46
|
Author: bart
Date: 2009-05-24 08:18:36 +0100 (Sun, 24 May 2009)
New Revision: 10126
Log:
Whitespace-only change.
Modified:
branches/DRDDEV/drd/drd_thread.c
Modified: branches/DRDDEV/drd/drd_thread.c
===================================================================
--- branches/DRDDEV/drd/drd_thread.c 2009-05-23 19:09:24 UTC (rev 10125)
+++ branches/DRDDEV/drd/drd_thread.c 2009-05-24 07:18:36 UTC (rev 10126)
@@ -311,6 +311,7 @@
{
tl_assert(DRD_(IsValidDrdThreadId)(drd_joiner));
tl_assert(DRD_(IsValidDrdThreadId)(drd_joinee));
+
DRD_(thread_new_segment)(drd_joinee);
DRD_(thread_combine_vc_join)(drd_joiner, drd_joinee);
DRD_(thread_new_segment)(drd_joiner);
|
|
From: Tom H. <th...@cy...> - 2009-05-24 02:44:07
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2009-05-24 03:05:04 BST Results unchanged from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... done Regression test results follow == 481 tests, 0 stderr failures, 0 stdout failures, 0 post failures == |
|
From: Tom H. <th...@cy...> - 2009-05-24 02:27:27
|
Nightly build on mg ( x86_64, Fedora 9 ) started at 2009-05-24 03:10:03 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 == 487 tests, 0 stderr failures, 1 stdout failure, 0 post failures == none/tests/linux/mremap2 (stdout) |