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
(1) |
|
2
(28) |
3
(21) |
4
(27) |
5
(22) |
6
(24) |
7
(25) |
8
(21) |
|
9
(18) |
10
(20) |
11
(10) |
12
(36) |
13
(18) |
14
(18) |
15
(29) |
|
16
(17) |
17
(7) |
18
(11) |
19
(17) |
20
(18) |
21
(12) |
22
(13) |
|
23
(9) |
24
(8) |
25
(7) |
26
(22) |
27
(18) |
28
(9) |
29
(15) |
|
30
(13) |
31
(7) |
|
|
|
|
|
|
From: <sv...@va...> - 2005-10-18 12:04:30
|
Author: sewardj
Date: 2005-10-18 13:04:18 +0100 (Tue, 18 Oct 2005)
New Revision: 4943
Log:
Change the core-tool interface so that tools are fully aware of both
the guest extents for the presented translation and also its original
un-redirected guest address. These changes are needed in particular
to make cachegrind's code cache management work properly.
Modified:
trunk/cachegrind/cg_main.c
trunk/coregrind/m_tooliface.c
trunk/coregrind/m_translate.c
trunk/coregrind/m_transtab.c
trunk/coregrind/pub_core_tooliface.h
trunk/helgrind/hg_main.c
trunk/include/pub_tool_tooliface.h
trunk/lackey/lk_main.c
trunk/massif/ms_main.c
trunk/memcheck/mc_include.h
trunk/memcheck/mc_translate.c
trunk/none/nl_main.c
Modified: trunk/cachegrind/cg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/cachegrind/cg_main.c 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/cachegrind/cg_main.c 2005-10-18 12:04:18 UTC (rev 4943)
@@ -141,7 +141,7 @@
=20
typedef struct _BB_info BB_info;
struct _BB_info {
- Addr BB_addr; // key
+ Addr BB_addr; // key; MUST BE FIRST
Int n_instrs;
InstrInfo instrs[0];
};
@@ -452,6 +452,8 @@
/*--- Instrumentation main ---*/
/*------------------------------------------------------------*/
=20
+// Note that origAddr is the real origAddr, not the address of the first
+// instruction in the block (they can be different due to redirection).
static
BB_info* get_BB_info(IRBB* bbIn, Addr origAddr)
{
@@ -731,8 +733,10 @@
////////////////////////////////////////////////////////////
=20
=20
-static IRBB* cg_instrument ( IRBB* bbIn, VexGuestLayout* layout,=20
- IRType gWordTy, IRType hWordTy )
+static
+IRBB* cg_instrument ( IRBB* bbIn, VexGuestLayout* layout,=20
+ Addr64 orig_addr_noredir, VexGuestExtents* vge,
+ IRType gWordTy, IRType hWordTy )
{
Int i, isize;
IRStmt* st;
@@ -763,7 +767,7 @@
=20
// Set up running state and get block info
cgs.events_used =3D 0;
- cgs.bbInfo =3D get_BB_info(bbIn, (Addr)cia);
+ cgs.bbInfo =3D get_BB_info(bbIn, (Addr)orig_addr_noredir);
cgs.bbInfo_i =3D 0;
=20
if (DEBUG_CG)
@@ -1241,18 +1245,22 @@
// Called when a translation is removed from the translation cache for
// any reason at all: to free up space, because the guest code was
// unmapped or modified, or for any arbitrary reason.
-static void cg_discard_basic_block_info ( VexGuestExtents vge )
+static
+void cg_discard_basic_block_info ( Addr64 orig_addr64, VexGuestExtents v=
ge )
{
BB_info* bbInfo;
+ Addr orig_addr =3D (Addr)orig_addr64;
=20
tl_assert(vge.n_used > 0);
=20
if (DEBUG_CG)
- VG_(printf)( "discard_basic_block_info: %p, %llu\n",=20
+ VG_(printf)( "discard_basic_block_info: %p, %p, %llu\n",=20
+ (void*)(Addr)orig_addr,
(void*)(Addr)vge.base[0], (ULong)vge.len[0]);
=20
- // Get BB info, remove from table, free BB info. Simple!
- bbInfo =3D VG_(OSet_Remove)(instrInfoTable, &(vge.base[0]));
+ // Get BB info, remove from table, free BB info. Simple! Note that =
we
+ // use orig_addr, not the first instruction address in vge.
+ bbInfo =3D VG_(OSet_Remove)(instrInfoTable, &orig_addr);
tl_assert(NULL !=3D bbInfo);
VG_(OSet_FreeNode)(instrInfoTable, bbInfo);
}
@@ -1375,7 +1383,7 @@
CC_table =3D VG_(OSet_Create)(offsetof(LineCC, loc),
cmp_CodeLoc_LineCC,
VG_(malloc), VG_(free));
- instrInfoTable =3D VG_(OSet_Create)(offsetof(BB_info, BB_addr),
+ instrInfoTable =3D VG_(OSet_Create)(/*keyOff*/0,
NULL,
VG_(malloc), VG_(free));
stringTable =3D VG_(OSet_Create)(/*keyOff*/0,
Modified: trunk/coregrind/m_tooliface.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_tooliface.c 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/coregrind/m_tooliface.c 2005-10-18 12:04:18 UTC (rev 4943)
@@ -40,7 +40,8 @@
=20
void VG_(basic_tool_funcs)(
void(*post_clo_init)(void),
- IRBB*(*instrument)(IRBB*, VexGuestLayout*, IRType, IRType ),
+ IRBB*(*instrument)(IRBB*, VexGuestLayout*,=20
+ Addr64, VexGuestExtents*, IRType, IRType ),
void(*fini)(Int)
)
{
@@ -154,7 +155,7 @@
NEEDS(data_syms)
=20
void VG_(needs_basic_block_discards)(
- void (*discard)(VexGuestExtents)
+ void (*discard)(Addr64, VexGuestExtents)
)
{
VG_(needs).basic_block_discards =3D True;
Modified: trunk/coregrind/m_translate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_translate.c 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/coregrind/m_translate.c 2005-10-18 12:04:18 UTC (rev 4943)
@@ -166,8 +166,12 @@
*/
=20
static
-IRBB* vg_SP_update_pass ( IRBB* bb_in, VexGuestLayout* layout,=20
- IRType gWordTy, IRType hWordTy )
+IRBB* vg_SP_update_pass ( IRBB* bb_in,=20
+ VexGuestLayout* layout,=20
+ Addr64 orig_addr_noredir,
+ VexGuestExtents* vge,
+ IRType gWordTy,=20
+ IRType hWordTy )
{
Int i, j, minoff_ST, maxoff_ST, sizeof_SP, offset_SP;
IRDirty *dcall, *d;
@@ -520,7 +524,7 @@
Int debugging_verbosity,
ULong bbs_done )
{
- Addr64 redir, orig_addr0 =3D orig_addr;
+ Addr64 redir, orig_addr_noredir =3D orig_addr;
Int tmpbuf_used, verbosity, i;
Bool notrace_until_done, do_self_check;
UInt notrace_until_limit =3D 0;
@@ -672,6 +676,7 @@
vex_arch, &vex_archinfo,
(UChar*)ULong_to_Ptr(orig_addr),=20
(Addr64)orig_addr,=20
+ (Addr64)orig_addr_noredir,=20
chase_into_ok,
&vge,
tmpbuf, N_TMPBUF, &tmpbuf_used,
@@ -711,10 +716,10 @@
// If debugging, don't do anything with the translated block; we
// only did this for the debugging output produced along the way.
if (!debugging_translation) {
- // Note that we use orig_addr0, not orig_addr, which might have be=
en
- // changed by the redirection
+ // Note that we use orig_addr_noredir, not orig_addr, which
+ // might have been changed by the redirection
VG_(add_to_transtab)( &vge,
- orig_addr0,
+ orig_addr_noredir,
(Addr)(&tmpbuf[0]),=20
tmpbuf_used,
do_self_check );
Modified: trunk/coregrind/m_transtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_transtab.c 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/coregrind/m_transtab.c 2005-10-18 12:04:18 UTC (rev 4943)
@@ -688,6 +688,7 @@
/* Tell the tool too. */
if (VG_(needs).basic_block_discards) {
VG_TDICT_CALL( tool_discard_basic_block_info,
+ sec->tt[i].entry,
sec->tt[i].vge );
}
} else {
@@ -1011,6 +1012,7 @@
/* Tell the tool too. */
if (VG_(needs).basic_block_discards) {
VG_TDICT_CALL( tool_discard_basic_block_info,
+ tte->entry,
tte->vge );
}
}
Modified: trunk/coregrind/pub_core_tooliface.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_tooliface.h 2005-10-18 02:30:42 UTC (rev 494=
2)
+++ trunk/coregrind/pub_core_tooliface.h 2005-10-18 12:04:18 UTC (rev 494=
3)
@@ -104,7 +104,8 @@
// Basic functions
void (*tool_pre_clo_init) (void);
void (*tool_post_clo_init)(void);
- IRBB* (*tool_instrument) (IRBB*, VexGuestLayout*, IRType, IRType);
+ IRBB* (*tool_instrument) (IRBB*, VexGuestLayout*,=20
+ Addr64, VexGuestExtents*, IRType, IRType)=
;
void (*tool_fini) (Int);
=20
// VG_(needs).core_errors
@@ -121,7 +122,7 @@
void (*tool_print_extra_suppression_info)(Error*);
=20
// VG_(needs).basic_block_discards
- void (*tool_discard_basic_block_info)(VexGuestExtents);
+ void (*tool_discard_basic_block_info)(Addr64, VexGuestExtents);
=20
// VG_(needs).command_line_options
Bool (*tool_process_cmd_line_option)(Char*);
Modified: trunk/helgrind/hg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/helgrind/hg_main.c 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/helgrind/hg_main.c 2005-10-18 12:04:18 UTC (rev 4943)
@@ -2297,8 +2297,10 @@
return cb;
}
#endif
-static IRBB* hg_instrument ( IRBB* bb_in, VexGuestLayout* layout,=20
- IRType gWordTy, IRType hWordTy )
+static
+IRBB* hg_instrument ( IRBB* bb_in, VexGuestLayout* layout,=20
+ Addr64 orig_addr_noredir, VexGuestExtents* vge,
+ IRType gWordTy, IRType hWordTy )
{
tl_assert(0); // Need to convert to Vex
}
Modified: trunk/include/pub_tool_tooliface.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/include/pub_tool_tooliface.h 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/include/pub_tool_tooliface.h 2005-10-18 12:04:18 UTC (rev 4943)
@@ -78,10 +78,14 @@
// processing.
void (*post_clo_init)(void),
=20
- // Instrument a basic block. Must be a true function, ie. the same i=
nput
- // always results in the same output, because basic blocks can be
- // retranslated. Unless you're doing something really strange...
- IRBB* (*instrument)(IRBB* bb_in, VexGuestLayout* layout,=20
+ // Instrument a basic block. Must be a true function, ie. the same
+ // input always results in the same output, because basic blocks
+ // can be retranslated. Unless you're doing something really
+ // strange... Note that orig_addr_noredir is not necessarily the
+ // same as the address of the first instruction in the IR, due to
+ // function redirection.
+ IRBB* (*instrument)(IRBB* bb_in, VexGuestLayout* layout,
+ Addr64 orig_addr_noredir, VexGuestExtents* vge,=20
IRType gWordTy, IRType hWordTy ),
=20
// Finish up, print out any results, etc. `exitcode' is program's ex=
it
@@ -195,19 +199,21 @@
reused for new translations. */
extern void VG_(needs_basic_block_discards) (
// Discard any information that pertains to specific translations
- // or instructions within the address range given. The "extents"
- // arg can be used in two ways.
- // - If info is being stored at a per-translation level, the first
- // address in the extents can be used to identify which translation
- // is being discarded. Each translation will be discarded exactly
- // once.
+ // or instructions within the address range given. There are two
+ // possible approaches.
+ // - If info is being stored at a per-translation level, use orig_add=
r
+ // to identify which translation is being discarded. Each translat=
ion
+ // will be discarded exactly once.
+ // This orig_addr will match the orig_addr which was passed to
+ // to instrument() when this translation was made. Note that orig_=
addr
+ // won't necessarily be the same as the first address in "extents".
// - If info is being stored at a per-instruction level, you can get
// the address range(s) being discarded by stepping through "extent=
s".
// Note that any single instruction may belong to more than one
// translation, and so could be covered by the "extents" of more th=
an
// one call to this function.
// Doing it the first way (as eg. Cachegrind does) is probably easier=
.
- void (*discard_basic_block_info)(VexGuestExtents vge)
+ void (*discard_basic_block_info)(Addr64 orig_addr, VexGuestExtents ex=
tents)
);
=20
/* Tool defines its own command line options? */
Modified: trunk/lackey/lk_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/lackey/lk_main.c 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/lackey/lk_main.c 2005-10-18 12:04:18 UTC (rev 4943)
@@ -124,8 +124,10 @@
Which gives us the right answer. And just to avoid two C calls, we f=
old
the basic-block-beginning call in with add_one_BB(). Phew.
*/=20
-static IRBB* lk_instrument(IRBB* bb_in, VexGuestLayout* layout,=20
- IRType gWordTy, IRType hWordTy )
+static
+IRBB* lk_instrument( IRBB* bb_in, VexGuestLayout* layout,=20
+ Addr64 orig_addr_noredir, VexGuestExtents* vge,
+ IRType gWordTy, IRType hWordTy )
{
IRDirty* di;
Int i;
Modified: trunk/massif/ms_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/massif/ms_main.c 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/massif/ms_main.c 2005-10-18 12:04:18 UTC (rev 4943)
@@ -1148,8 +1148,10 @@
/*--- Instrumentation ---*/
/*------------------------------------------------------------*/
=20
-static IRBB* ms_instrument ( IRBB* bb_in, VexGuestLayout* layout,=20
- IRType gWordTy, IRType hWordTy )
+static
+IRBB* ms_instrument ( IRBB* bb_in, VexGuestLayout* layout,=20
+ Addr64 orig_addr_noredir, VexGuestExtents* vge,
+ IRType gWordTy, IRType hWordTy )
{
/* XXX Will Massif work when gWordTy !=3D hWordTy ? */
return bb_in;
Modified: trunk/memcheck/mc_include.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mc_include.h 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/memcheck/mc_include.h 2005-10-18 12:04:18 UTC (rev 4943)
@@ -79,10 +79,11 @@
extern void MC_(helperc_MAKE_STACK_UNINIT) ( Addr base, UWord len );
=20
/* Functions defined in mc_translate.c */
-extern IRBB* MC_(instrument) ( IRBB* bb_in, VexGuestLayout* layout,
- IRType gWordTy, IRType hWordTy );
+extern
+IRBB* MC_(instrument) ( IRBB* bb_in, VexGuestLayout* layout,=20
+ Addr64 orig_addr_noredir, VexGuestExtents* vge,
+ IRType gWordTy, IRType hWordTy );
=20
-
#endif /* ndef __MC_INCLUDE_H */
=20
/*--------------------------------------------------------------------*/
Modified: trunk/memcheck/mc_translate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mc_translate.c 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/memcheck/mc_translate.c 2005-10-18 12:04:18 UTC (rev 4943)
@@ -2810,6 +2810,7 @@
=20
=20
IRBB* MC_(instrument) ( IRBB* bb_in, VexGuestLayout* layout,=20
+ Addr64 orig_addr_noredir, VexGuestExtents* vge,
IRType gWordTy, IRType hWordTy )
{
Bool verboze =3D False; //True;=20
Modified: trunk/none/nl_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/none/nl_main.c 2005-10-18 02:30:42 UTC (rev 4942)
+++ trunk/none/nl_main.c 2005-10-18 12:04:18 UTC (rev 4943)
@@ -36,8 +36,10 @@
{
}
=20
-static IRBB* nl_instrument(IRBB* bb, VexGuestLayout* layout,=20
- IRType gWordTy, IRType hWordTy)
+static
+IRBB* nl_instrument(IRBB* bb, VexGuestLayout* layout,=20
+ Addr64 orig_addr_noredir, VexGuestExtents* vge,
+ IRType gWordTy, IRType hWordTy)
{
return bb;
}
|
|
From: <sv...@va...> - 2005-10-18 12:01:57
|
Author: sewardj
Date: 2005-10-18 13:01:48 +0100 (Tue, 18 Oct 2005)
New Revision: 1420
Log:
API change: pass both the VexGuestExtents and the original
pre-redirection guest address to instrumentation functions.
Modified:
trunk/priv/main/vex_main.c
trunk/pub/libvex.h
trunk/test_main.c
Modified: trunk/priv/main/vex_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/priv/main/vex_main.c 2005-10-12 11:34:33 UTC (rev 1419)
+++ trunk/priv/main/vex_main.c 2005-10-18 12:01:48 UTC (rev 1420)
@@ -179,8 +179,13 @@
VexArch arch_host,
VexArchInfo* archinfo_host,
/* IN: the block to translate, and its guest address. */
+ /* where are the actual bytes in the host's address space? */
UChar* guest_bytes,
+ /* where do the bytes came from in the guest's aspace? */
Addr64 guest_bytes_addr,
+ /* what guest entry point address do they correspond to? */
+ Addr64 guest_bytes_addr_noredir,
+ /* Is it OK to chase into this guest address? */
Bool (*chase_into_ok) ( Addr64 ),
/* OUT: which bits of guest code actually got translated */
VexGuestExtents* guest_extents,
@@ -191,8 +196,10 @@
Int* host_bytes_used,
/* IN: optionally, two instrumentation functions. */
IRBB* (*instrument1) ( IRBB*, VexGuestLayout*,=20
+ Addr64, VexGuestExtents*,=20
IRType gWordTy, IRType hWordTy ),
IRBB* (*instrument2) ( IRBB*, VexGuestLayout*,=20
+ Addr64, VexGuestExtents*,
IRType gWordTy, IRType hWordTy ),
Bool cleanup_after_instrumentation,
/* IN: should this translation be self-checking? */
@@ -463,10 +470,12 @@
/* Get the thing instrumented. */
if (instrument1)
irbb =3D (*instrument1)(irbb, guest_layout,=20
- guest_word_type, host_word_type);
+ guest_bytes_addr_noredir, guest_extents,
+ guest_word_type, host_word_type);
if (instrument2)
irbb =3D (*instrument2)(irbb, guest_layout,
- guest_word_type, host_word_type);
+ guest_bytes_addr_noredir, guest_extents,
+ guest_word_type, host_word_type);
=20
if (vex_traceflags & VEX_TRACE_INST) {
vex_printf("\n------------------------"=20
Modified: trunk/pub/libvex.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/pub/libvex.h 2005-10-12 11:34:33 UTC (rev 1419)
+++ trunk/pub/libvex.h 2005-10-18 12:01:48 UTC (rev 1420)
@@ -275,14 +275,20 @@
=20
extern=20
VexTranslateResult LibVEX_Translate (
+
/* The instruction sets we are translating from and to. */
VexArch arch_guest,
VexArchInfo* archinfo_guest,
VexArch arch_host,
VexArchInfo* archinfo_host,
/* IN: the block to translate, and its guest address. */
+ /* where are the actual bytes in the host's address space? */
UChar* guest_bytes,
+ /* where do the bytes came from in the guest's aspace? */
Addr64 guest_bytes_addr,
+ /* what guest entry point address do they correspond to? */
+ Addr64 guest_bytes_addr_noredir,
+ /* Is it OK to chase into this guest address? */
Bool (*chase_into_ok) ( Addr64 ),
/* OUT: which bits of guest code actually got translated */
VexGuestExtents* guest_extents,
@@ -293,8 +299,10 @@
Int* host_bytes_used,
/* IN: optionally, two instrumentation functions. */
IRBB* (*instrument1) ( IRBB*, VexGuestLayout*,=20
+ Addr64, VexGuestExtents*,
IRType gWordTy, IRType hWordTy ),
IRBB* (*instrument2) ( IRBB*, VexGuestLayout*,=20
+ Addr64, VexGuestExtents*,
IRType gWordTy, IRType hWordTy ),
Bool cleanup_after_instrumentation,
/* IN: should this translation be self-checking? */
Modified: trunk/test_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/test_main.c 2005-10-12 11:34:33 UTC (rev 1419)
+++ trunk/test_main.c 2005-10-18 12:01:48 UTC (rev 1420)
@@ -148,7 +148,8 @@
VexArchX86, &vai_x86,=20
VexArchX86, &vai_x86,=20
#endif
- origbuf, (Addr64)orig_addr, chase_into_not_ok,
+ origbuf, (Addr64)orig_addr, (Addr64)orig_addr,
+ chase_into_not_ok,
&vge,
transbuf, N_TRANSBUF, &trans_used,
#if 1 /* no instrumentation */
|
|
From: <js...@ac...> - 2005-10-18 02:50:39
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-10-18 03:30:00 BST Checking out vex source tree ... done Building vex ... done Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 200 tests, 2 stderr failures, 0 stdout failures ================= none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <to...@co...> - 2005-10-18 02:40:54
|
Nightly build on dunsmere ( athlon, Fedora Core 4 ) started at 2005-10-18 03:30:04 BST Results differ from 24 hours ago Checking out valgrind source tree ... done Configuring valgrind ... done Building valgrind ... done Running regression tests ... failed Regression test results follow == 202 tests, 12 stderr failures, 4 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/mempool (stderr) memcheck/tests/nanoleak_supp (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/map_unmap (stdout) none/tests/map_unmap (stderr) none/tests/mremap2 (stdout) none/tests/sigstackgrowth (stdout) none/tests/sigstackgrowth (stderr) none/tests/stackgrowth (stdout) none/tests/stackgrowth (stderr) none/tests/x86/int (stderr) ================================================= == 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 == 202 tests, 12 stderr failures, 4 stdout failures ================= memcheck/tests/badjump2 (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/mempool (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/map_unmap (stdout) none/tests/map_unmap (stderr) none/tests/mremap2 (stdout) none/tests/sigstackgrowth (stdout) none/tests/sigstackgrowth (stderr) none/tests/stackgrowth (stdout) none/tests/stackgrowth (stderr) none/tests/x86/int (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Tue Oct 18 03:35:30 2005 --- new.short Tue Oct 18 03:40:43 2005 *************** *** 9,13 **** == 202 tests, 12 stderr failures, 4 stdout failures ================= - memcheck/tests/badjump2 (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/mempool (stderr) memcheck/tests/pointer-trace (stderr) --- 9,13 ---- == 202 tests, 12 stderr failures, 4 stdout failures ================= memcheck/tests/leak-tree (stderr) memcheck/tests/mempool (stderr) + memcheck/tests/nanoleak_supp (stderr) memcheck/tests/pointer-trace (stderr) |
|
From: <sv...@va...> - 2005-10-18 02:30:47
|
Author: sewardj
Date: 2005-10-18 03:30:42 +0100 (Tue, 18 Oct 2005)
New Revision: 4942
Log:
Add extra auxiliary data structures which make it possible to quickly
find and delete all translations intersecting with small address
ranges (8 k or less, currently). This makes it possible to simulate
ppc32 icbi instructions in reasonable time, and finally makes the
ppc32 port run at a usable speed.
The scheme is based around partitioning translations into equivalence
classes based on address ranges. For deletions whose range falls
within a single class, all translations intersecting it can be found
by inspecting just that class and one other. Given that there are 256
classes, this cuts the cost, relative to scanning the entire TC, by
approximately half that factor (viz, 128), assuming the translations
are distributed evenly over the classes.
The whole business is more complex and difficult than I would like.
A detailed comment will later be added.
Very thorough sanity checking has been added
(sanity_check_eclasses_in_sector). This is engaged at
--sanity-level=3D4 and above.
The TT hash function (HASH_TT) has been improved to reduce its
tendency to cluster TT entries in some circumstances. This has
allowed the TT maximum loading factor to be increased from 66% to 80%
and so the absolute size of the TC (in each sector) to be less than
2^16 entries. The latter change is important for the fast-deletion
changes.
Modified:
trunk/coregrind/m_transtab.c
Modified: trunk/coregrind/m_transtab.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_transtab.c 2005-10-18 02:20:18 UTC (rev 4941)
+++ trunk/coregrind/m_transtab.c 2005-10-18 02:30:42 UTC (rev 4942)
@@ -55,20 +55,33 @@
#define N_SECTORS 8
=20
/* Number of TC entries in each sector. This needs to be a prime
- number to work properly, and it is strongly recommended not to
- change this. */
-#define N_TTES_PER_SECTOR /*30011*/ /*40009*/ 80021
+ number to work properly, it must be <=3D 65535 (so that a TT index
+ fits in a UShort, leaving room for 0xFFFF(EC2TTE_DELETED) to denote
+ 'deleted') and it is strongly recommended not to change this.
+ 65521 is the largest prime <=3D 65535. */
+#define N_TTES_PER_SECTOR /*30011*/ /*40009*/ 65521
=20
/* Because each sector contains a hash table of TTEntries, we need to
specify the maximum allowable loading, after which the sector is
deemed full. */
-#define SECTOR_TT_LIMIT_PERCENT 66
+#define SECTOR_TT_LIMIT_PERCENT 80
=20
/* The sector is deemed full when this many entries are in it. */
#define N_TTES_PER_SECTOR_USABLE \
((N_TTES_PER_SECTOR * SECTOR_TT_LIMIT_PERCENT) / 100)
=20
+/* Equivalence classes for fast address range deletion. There are 1 +
+ 2^ECLASS_WIDTH bins. The highest one, ECLASS_MISC, describes an
+ address range which does not fall cleanly within any specific bin.
+ Note that ECLASS_SHIFT + ECLASS_WIDTH must be < 32. */
+#define ECLASS_SHIFT 11
+#define ECLASS_WIDTH 8
+#define ECLASS_MISC (1 << ECLASS_WIDTH)
+#define ECLASS_N (1 + ECLASS_MISC)
=20
+#define EC2TTE_DELETED 0xFFFF /* 16-bit special value */
+
+
/*------------------ TYPES ------------------*/
=20
/* A translation-cache entry is two parts:
@@ -123,6 +136,20 @@
delete it when translations of a given address range are
invalidated. */
VexGuestExtents vge;
+
+ /* Address range summary info: these are pointers back to
+ eclass[] entries in the containing Sector. Those entries in
+ turn point back here -- the two structures are mutually
+ redundant but both necessary to make fast deletions work.
+ The eclass info is similar to, and derived from, this entry's
+ 'vge' field, but it is not the same */
+ UShort n_tte2ec; // # tte2ec pointers (1 to 3)
+ UShort tte2ec_ec[3]; // for each, the eclass #
+ UInt tte2ec_ix[3]; // and the index within the eclass.
+ // for i in 0 .. n_tte2ec-1
+ // sec->ec2tte[ tte2ec_ec[i] ][ tte2ec_ix[i] ]=20
+ // should be the index=20
+ // of this TTEntry in the containing Sector's tt array.
}
TTEntry;
=20
@@ -153,6 +180,14 @@
=20
/* The count of tt entries with state InUse. */
Int tt_n_inuse;
+
+ /* Expandable arrays of tt indices for each of the ECLASS_N
+ address range equivalence classes. These hold indices into
+ the containing sector's tt array, which in turn should point
+ back here. */
+ Int ec2tte_size[ECLASS_N];
+ Int ec2tte_used[ECLASS_N];
+ UShort* ec2tte[ECLASS_N];
}
Sector;
=20
@@ -243,9 +278,304 @@
ULong n_disc_osize =3D 0;
=20
=20
+/*-------------------------------------------------------------*/
+/*--- Address-range equivalence class stuff ---*/
+/*-------------------------------------------------------------*/
=20
+/* Return equivalence class number for a range. */
+
+static Int range_to_eclass ( Addr64 start, UInt len )
+{
+ UInt mask =3D (1 << ECLASS_WIDTH) - 1;
+ UInt lo =3D (UInt)start;
+ UInt hi =3D lo + len - 1;
+ UInt loBits =3D (lo >> ECLASS_SHIFT) & mask;
+ UInt hiBits =3D (hi >> ECLASS_SHIFT) & mask;
+ if (loBits =3D=3D hiBits) {
+ vg_assert(loBits < ECLASS_N-1);
+ return loBits;
+ } else {
+ return ECLASS_MISC;
+ }
+}
+
+
+/* Calculates the equivalence class numbers for any VexGuestExtent.
+ These are written in *eclasses, which must be big enough to hold 3
+ Ints. The number written, between 1 and 3, is returned. The
+ eclasses are presented in order, and any duplicates are removed.
+*/
+
+static=20
+Int vexGuestExtents_to_eclasses ( /*OUT*/Int* eclasses,
+ VexGuestExtents* vge )
+{
+# define SWAP(_lv1,_lv2) \
+ do { Int t =3D _lv1; _lv1 =3D _lv2; _lv2 =3D t; } while (0)
+
+ Int i, j, n_ec, r;
+
+ vg_assert(vge->n_used >=3D 1 && vge->n_used <=3D 3);
+
+ n_ec =3D 0;
+ for (i =3D 0; i < vge->n_used; i++) {
+ r =3D range_to_eclass( vge->base[i], (UInt)vge->len[i] );
+ if (r =3D=3D ECLASS_MISC)=20
+ goto bad;
+ /* only add if we haven't already seen it */
+ for (j =3D 0; j < n_ec; j++)
+ if (eclasses[j] =3D=3D r)
+ break;
+ if (j =3D=3D n_ec)
+ eclasses[n_ec++] =3D r;
+ }
+
+ if (n_ec =3D=3D 1)
+ return 1;
+
+ if (n_ec =3D=3D 2) {
+ /* sort */
+ if (eclasses[0] > eclasses[1])
+ SWAP(eclasses[0], eclasses[1]);
+ return 2;
+ }
+
+ if (n_ec =3D=3D 3) {
+ /* sort */
+ if (eclasses[0] > eclasses[2])
+ SWAP(eclasses[0], eclasses[2]);
+ if (eclasses[0] > eclasses[1])
+ SWAP(eclasses[0], eclasses[1]);
+ if (eclasses[1] > eclasses[2])
+ SWAP(eclasses[1], eclasses[2]);
+ return 3;
+ }
+
+ /* NOTREACHED */
+ vg_assert(0);
+
+ bad:
+ eclasses[0] =3D ECLASS_MISC;
+ return 1;
+
+# undef SWAP
+}
+
+
+/* Add tteno to the set of entries listed for equivalence class ec in
+ this sector. Returns used location in eclass array. */
+
+static=20
+UInt addEClassNo ( /*MOD*/Sector* sec, Int ec, UShort tteno )
+{
+ Int old_sz, new_sz, i, r;
+ UShort *old_ar, *new_ar;
+
+ vg_assert(ec >=3D 0 && ec < ECLASS_N);
+ vg_assert(tteno < N_TTES_PER_SECTOR);
+
+ if (0) VG_(printf)("ec %d gets %d\n", ec, (Int)tteno);
+
+ if (sec->ec2tte_used[ec] >=3D sec->ec2tte_size[ec]) {
+
+ vg_assert(sec->ec2tte_used[ec] =3D=3D sec->ec2tte_size[ec]);
+
+ old_sz =3D sec->ec2tte_size[ec];
+ old_ar =3D sec->ec2tte[ec];
+ new_sz =3D old_sz=3D=3D0 ? 8 : old_sz<64 ? 2*old_sz : (3*old_sz)/2=
;
+ new_ar =3D VG_(arena_malloc)(VG_AR_TTAUX, new_sz * sizeof(UShort))=
;
+ for (i =3D 0; i < old_sz; i++)
+ new_ar[i] =3D old_ar[i];
+ if (old_ar)
+ VG_(arena_free)(VG_AR_TTAUX, old_ar);
+ sec->ec2tte_size[ec] =3D new_sz;
+ sec->ec2tte[ec] =3D new_ar;
+
+ if (0) VG_(printf)("expand ec %d to %d\n", ec, new_sz);
+ }
+
+ /* Common case */
+ r =3D sec->ec2tte_used[ec]++;
+ vg_assert(r >=3D 0 && r < sec->ec2tte_size[ec]);
+ sec->ec2tte[ec][r] =3D tteno;
+ return (UInt)r;
+}
+
+
+/* 'vge' is being added to 'sec' at TT entry 'tteno'. Add appropriate
+ eclass entries to 'sec'. */
+
+static=20
+void upd_eclasses_after_add ( /*MOD*/Sector* sec, Int tteno )
+{
+ Int i, r, eclasses[3];
+ TTEntry* tte;
+ vg_assert(tteno >=3D 0 && tteno < N_TTES_PER_SECTOR);
+
+ tte =3D &sec->tt[tteno];
+ r =3D vexGuestExtents_to_eclasses( eclasses, &tte->vge );
+
+ vg_assert(r >=3D 1 && r <=3D 3);
+ tte->n_tte2ec =3D r;
+
+ for (i =3D 0; i < r; i++) {
+ tte->tte2ec_ec[i] =3D eclasses[i];
+ tte->tte2ec_ix[i] =3D addEClassNo( sec, eclasses[i], (UShort)tteno=
);
+ }
+}
+
+
+/* Check the eclass info in 'sec' to ensure it is consistent. Returns
+ True if OK, False if something's not right. Expensive. */
+
+static Bool sanity_check_eclasses_in_sector ( Sector* sec )
+{
+# define BAD(_str) do { whassup =3D (_str); goto bad; } while (0)
+
+ HChar* whassup =3D NULL;
+ Int i, j, k, n, ec_num, ec_idx;
+ TTEntry* tte;
+ UShort tteno;
+ ULong* tce;
+
+ /* Basic checks on this sector */
+ if (sec->tt_n_inuse < 0 || sec->tt_n_inuse > N_TTES_PER_SECTOR_USABLE=
)
+ BAD("invalid sec->tt_n_inuse");
+ tce =3D sec->tc_next;
+ if (tce < &sec->tc[0] || tce > &sec->tc[tc_sector_szQ])
+ BAD("sec->tc_next points outside tc");
+
+ /* For each eclass ... */
+ for (i =3D 0; i < ECLASS_N; i++) {
+ if (sec->ec2tte_size[i] =3D=3D 0 && sec->ec2tte[i] !=3D NULL)
+ BAD("ec2tte_size/ec2tte mismatch(1)");
+ if (sec->ec2tte_size[i] !=3D 0 && sec->ec2tte[i] =3D=3D NULL)
+ BAD("ec2tte_size/ec2tte mismatch(2)");
+ if (sec->ec2tte_used[i] < 0=20
+ || sec->ec2tte_used[i] > sec->ec2tte_size[i])
+ BAD("implausible ec2tte_used");
+ if (sec->ec2tte_used[i] =3D=3D 0)
+ continue;
+
+ /* For each tt reference in each eclass .. ensure the reference
+ is to a valid tt entry, and that the entry's address ranges
+ really include this eclass. */
+
+ for (j =3D 0; j < sec->ec2tte_used[i]; j++) {
+ tteno =3D sec->ec2tte[i][j];
+ if (tteno =3D=3D EC2TTE_DELETED)
+ continue;
+ if (tteno >=3D N_TTES_PER_SECTOR)
+ BAD("implausible tteno");
+ tte =3D &sec->tt[tteno];
+ if (tte->status !=3D InUse)
+ BAD("tteno points to non-inuse tte");
+ if (tte->n_tte2ec < 1 || tte->n_tte2ec > 3)
+ BAD("tte->n_tte2ec out of range");
+ /* Exactly least one of tte->eclasses[0 .. tte->n_eclasses-1]
+ must equal i. Inspect tte's eclass info. */
+ n =3D 0;
+ for (k =3D 0; k < tte->n_tte2ec; k++) {
+ if (k < tte->n_tte2ec-1
+ && tte->tte2ec_ec[k] >=3D tte->tte2ec_ec[k+1])
+ BAD("tte->tte2ec_ec[..] out of order");
+ ec_num =3D tte->tte2ec_ec[k];
+ if (ec_num < 0 || ec_num >=3D ECLASS_N)
+ BAD("tte->tte2ec_ec[..] out of range");
+ if (ec_num !=3D i)
+ continue;
+ ec_idx =3D tte->tte2ec_ix[k];
+ if (ec_idx < 0 || ec_idx >=3D sec->ec2tte_used[i])
+ BAD("tte->tte2ec_ix[..] out of range");
+ if (ec_idx =3D=3D j)
+ n++;
+ }
+ if (n !=3D 1)
+ BAD("tteno does not point back at eclass");
+ }
+ }
+
+ /* That establishes that for each forward pointer from TTEntrys
+ there is a corresponding backward pointer from the eclass[]
+ arrays. However, it doesn't rule out the possibility of other,
+ bogus pointers in the eclass[] arrays. So do those similarly:
+ scan through them and check the TTEntryies they point at point
+ back. */
+
+ for (i =3D 0; i < N_TTES_PER_SECTOR_USABLE; i++) {
+
+ tte =3D &sec->tt[i];
+ if (tte->status =3D=3D Empty || tte->status =3D=3D Deleted) {
+ if (tte->n_tte2ec !=3D 0)
+ BAD("tte->n_eclasses nonzero for unused tte");
+ continue;
+ }
+
+ vg_assert(tte->status =3D=3D InUse);
+
+ if (tte->n_tte2ec < 1 || tte->n_tte2ec > 3)
+ BAD("tte->n_eclasses out of range(2)");
+
+ for (j =3D 0; j < tte->n_tte2ec; j++) {
+ ec_num =3D tte->tte2ec_ec[j];
+ if (ec_num < 0 || ec_num >=3D ECLASS_N)
+ BAD("tte->eclass[..] out of range");
+ ec_idx =3D tte->tte2ec_ix[j];
+ if (ec_idx < 0 || ec_idx >=3D sec->ec2tte_used[ec_num])
+ BAD("tte->ec_idx[..] out of range(2)");
+ if (sec->ec2tte[ec_num][ec_idx] !=3D i)
+ BAD("ec2tte does not point back to tte");
+ }
+ }
+
+ return True;
+
+ bad:
+ if (whassup)
+ VG_(debugLog)(0, "transtab", "eclass sanity fail: %s\n", whassup);
+
+# if 0
+ VG_(printf)("eclass =3D %d\n", i);
+ VG_(printf)("tteno =3D %d\n", (Int)tteno);
+ switch (tte->status) {
+ case InUse: VG_(printf)("InUse\n"); break;
+ case Deleted: VG_(printf)("Deleted\n"); break;
+ case Empty: VG_(printf)("Empty\n"); break;
+ }
+ if (tte->status !=3D Empty) {
+ for (k =3D 0; k < tte->vge.n_used; k++)
+ VG_(printf)("0x%llx %d\n", tte->vge.base[k],=20
+ (Int)tte->vge.len[k]);
+ }
+# endif
+
+ return False;
+
+# undef BAD
+}
+
+
+/* Sanity check absolutely everything. True =3D=3D check passed. */
+
+static Bool sanity_check_all_sectors ( void )
+{
+ Int sno;
+ Bool sane;
+ Sector* sec;
+ for (sno =3D 0; sno < N_SECTORS; sno++) {
+ sec =3D §ors[sno];
+ if (sec->tc =3D=3D NULL)
+ continue;
+ sane =3D sanity_check_eclasses_in_sector( sec );
+ if (!sane)
+ return False;
+ }
+ return True;
+}
+
+
/*-------------------------------------------------------------*/
-/*--- Add/delete/find translations ---*/
+/*--- Add/find translations ---*/
/*-------------------------------------------------------------*/
=20
static UInt vge_osize ( VexGuestExtents* vge )
@@ -267,7 +597,11 @@
{
UInt kHi =3D (UInt)(key >> 32);
UInt kLo =3D (UInt)key;
- return (kHi ^ kLo) % N_TTES_PER_SECTOR;
+ UInt k32 =3D kHi ^ kLo;
+ UInt ror =3D 7;
+ if (ror > 0)
+ k32 =3D (k32 >> ror) | (k32 << (32-ror));
+ return k32 % N_TTES_PER_SECTOR;
}
=20
static void setFastCacheEntry ( Addr64 key, ULong* tce, UInt* count )
@@ -292,14 +626,23 @@
{
Int i;
SysRes sres;
+ Sector* sec;
vg_assert(isValidSector(sno));
=20
- if (sectors[sno].tc =3D=3D NULL) {
+ sec =3D §ors[sno];
+
+ if (sec->tc =3D=3D NULL) {
+
/* Sector has never been used before. Need to allocate tt and
tc. */
- vg_assert(sectors[sno].tt =3D=3D NULL);
- vg_assert(sectors[sno].tc_next =3D=3D NULL);
- vg_assert(sectors[sno].tt_n_inuse =3D=3D 0);
+ vg_assert(sec->tt =3D=3D NULL);
+ vg_assert(sec->tc_next =3D=3D NULL);
+ vg_assert(sec->tt_n_inuse =3D=3D 0);
+ for (i =3D 0; i < ECLASS_N; i++) {
+ vg_assert(sec->ec2tte_size[i] =3D=3D 0);
+ vg_assert(sec->ec2tte_used[i] =3D=3D 0);
+ vg_assert(sec->ec2tte[i] =3D=3D NULL);
+ }
=20
VG_(debugLog)(1,"transtab", "allocate sector %d\n", sno);
=20
@@ -309,7 +652,7 @@
8 * tc_sector_szQ );
/*NOTREACHED*/
}
- sectors[sno].tc =3D (ULong*)sres.val;
+ sec->tc =3D (ULong*)sres.val;
=20
sres =3D VG_(am_mmap_anon_float_valgrind)
( N_TTES_PER_SECTOR * sizeof(TTEntry) );
@@ -318,34 +661,62 @@
N_TTES_PER_SECTOR * sizeof(TTEntry)=
);
/*NOTREACHED*/
}
- sectors[sno].tt =3D (TTEntry*)sres.val;
+ sec->tt =3D (TTEntry*)sres.val;
=20
+ for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
+ sec->tt[i].status =3D Empty;
+ sec->tt[i].n_tte2ec =3D 0;
+ }
+
if (VG_(clo_verbosity) > 2)
VG_(message)(Vg_DebugMsg, "TT/TC: initialise sector %d", sno);
+
} else {
- /* Sector has been used before. */
+
+ /* Sector has been used before. Dump the old contents. */
VG_(debugLog)(1,"transtab", "recycle sector %d\n", sno);
- vg_assert(sectors[sno].tt !=3D NULL);
- vg_assert(sectors[sno].tc_next !=3D NULL);
- n_dump_count +=3D sectors[sno].tt_n_inuse;
+ vg_assert(sec->tt !=3D NULL);
+ vg_assert(sec->tc_next !=3D NULL);
+ n_dump_count +=3D sec->tt_n_inuse;
+
+ /* Visit each just-about-to-be-abandoned translation. */
for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
- if (sectors[sno].tt[i].status =3D=3D InUse) {
- n_dump_osize +=3D vge_osize(§ors[sno].tt[i].vge);
+ if (sec->tt[i].status =3D=3D InUse) {
+ vg_assert(sec->tt[i].n_tte2ec >=3D 1);
+ vg_assert(sec->tt[i].n_tte2ec <=3D 3);
+ n_dump_osize +=3D vge_osize(&sec->tt[i].vge);
/* Tell the tool too. */
if (VG_(needs).basic_block_discards) {
VG_TDICT_CALL( tool_discard_basic_block_info,
- sectors[sno].tt[i].vge );
+ sec->tt[i].vge );
}
+ } else {
+ vg_assert(sec->tt[i].n_tte2ec =3D=3D 0);
}
+ sec->tt[i].status =3D Empty;
+ sec->tt[i].n_tte2ec =3D 0;
}
+
+ /* Free up the eclass structures. */
+ for (i =3D 0; i < ECLASS_N; i++) {
+ if (sec->ec2tte_size[i] =3D=3D 0) {
+ vg_assert(sec->ec2tte_used[i] =3D=3D 0);
+ vg_assert(sec->ec2tte[i] =3D=3D NULL);
+ } else {
+ vg_assert(sec->ec2tte[i] !=3D NULL);
+ VG_(arena_free)(VG_AR_TTAUX, sec->ec2tte[i]);
+ sec->ec2tte[i] =3D NULL;
+ sec->ec2tte_size[i] =3D 0;
+ sec->ec2tte_used[i] =3D 0;
+ }
+ }
+
if (VG_(clo_verbosity) > 2)
VG_(message)(Vg_DebugMsg, "TT/TC: recycle sector %d", sno);
}
=20
- sectors[sno].tc_next =3D sectors[sno].tc;
- sectors[sno].tt_n_inuse =3D 0;
- for (i =3D 0; i < N_TTES_PER_SECTOR; i++)
- sectors[sno].tt[i].status =3D Empty;
+ sec->tc_next =3D sec->tc;
+ sec->tt_n_inuse =3D 0;
=20
invalidateFastCache();
}
@@ -498,7 +869,11 @@
sectors[y].tt[i].vge =3D *vge;
sectors[y].tt[i].entry =3D entry;
=20
+ /* Update the fast-cache. */
setFastCacheEntry( entry, tce, §ors[y].tt[i].count );
+
+ /* Note the eclass numbers for this translation. */
+ upd_eclasses_after_add( §ors[y], i );
}
=20
=20
@@ -564,10 +939,14 @@
}
=20
=20
-/* Delete all translations which intersect with any part of the
- specified guest address range. Note, this is SLOW.=20
-*/
+/*-------------------------------------------------------------*/
+/*--- Delete translations. ---*/
+/*-------------------------------------------------------------*/
=20
+/* Stuff for deleting translations which intersect with a given
+ address range. Unfortunately, to make this run at a reasonable
+ speed, it is complex. */
+
static inline
Bool overlap1 ( Addr64 s1, ULong r1, Addr64 s2, ULong r2 )
{
@@ -595,11 +974,115 @@
}
=20
=20
+/* Delete a tt entry, and update all the eclass data accordingly. */
+
+static void delete_tte ( /*MOD*/Sector* sec, Int tteno )
+{
+ Int i, ec_num, ec_idx;
+ TTEntry* tte;
+
+ vg_assert(tteno >=3D 0 && tteno < N_TTES_PER_SECTOR);
+ tte =3D &sec->tt[tteno];
+ vg_assert(tte->status =3D=3D InUse);
+ vg_assert(tte->n_tte2ec >=3D 1 && tte->n_tte2ec <=3D 3);
+
+ /* Deal with the ec-to-tte links first. */
+ for (i =3D 0; i < tte->n_tte2ec; i++) {
+ ec_num =3D (Int)tte->tte2ec_ec[i];
+ ec_idx =3D tte->tte2ec_ix[i];
+ vg_assert(ec_num >=3D 0 && ec_num < ECLASS_N);
+ vg_assert(ec_idx >=3D 0);
+ vg_assert(ec_idx < sec->ec2tte_used[ec_num]);
+ /* Assert that the two links point at each other. */
+ vg_assert(sec->ec2tte[ec_num][ec_idx] =3D=3D (UShort)tteno);
+ /* "delete" the pointer back to here. */
+ sec->ec2tte[ec_num][ec_idx] =3D EC2TTE_DELETED;
+ }
+
+ /* Now fix up this TTEntry. */
+ tte->status =3D Deleted;
+ tte->n_tte2ec =3D 0;
+
+ /* Stats .. */
+ sec->tt_n_inuse--;
+ n_disc_count++;
+ n_disc_osize +=3D vge_osize(&tte->vge);
+
+ /* Tell the tool too. */
+ if (VG_(needs).basic_block_discards) {
+ VG_TDICT_CALL( tool_discard_basic_block_info,
+ tte->vge );
+ }
+}
+
+
+/* Delete translations from sec which intersect specified range, but
+ only consider translations in the specified eclass. */
+
+static=20
+Bool delete_translations_in_sector_eclass ( /*MOD*/Sector* sec,=20
+ Addr64 guest_start, ULong ra=
nge,
+ Int ec )
+{
+ Int i;
+ UShort tteno;
+ Bool anyDeld =3D False;
+ TTEntry* tte;
+
+ vg_assert(ec >=3D 0 && ec < ECLASS_N);
+
+ for (i =3D 0; i < sec->ec2tte_used[ec]; i++) {
+
+ tteno =3D sec->ec2tte[ec][i];
+ if (tteno =3D=3D EC2TTE_DELETED) {
+ /* already deleted */
+ continue;
+ }
+
+ vg_assert(tteno < N_TTES_PER_SECTOR);
+
+ tte =3D &sec->tt[tteno];
+ vg_assert(tte->status =3D=3D InUse);
+
+ if (overlaps( guest_start, range, &tte->vge )) {
+ anyDeld =3D True;
+ delete_tte( sec, (Int)tteno );
+ }
+
+ }
+
+ return anyDeld;
+}
+
+
+/* Delete translations from sec which intersect specified range, the
+ slow way, by inspecting all translations in sec. */
+
+static=20
+Bool delete_translations_in_sector ( /*MOD*/Sector* sec,=20
+ Addr64 guest_start, ULong range )
+{
+ Int i;
+ Bool anyDeld =3D False;
+
+ for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
+ if (sec->tt[i].status =3D=3D InUse
+ && overlaps( guest_start, range, &sec->tt[i].vge )) {
+ anyDeld =3D True;
+ delete_tte( sec, i );
+ }
+ }
+
+ return anyDeld;
+}=20
+
+
void VG_(discard_translations) ( Addr64 guest_start, ULong range,
HChar* who )
{
- Int sno, i;
- Bool anyDeleted =3D False;
+ Sector* sec;
+ Int sno, ec;
+ Bool anyDeleted =3D False;
=20
vg_assert(init_done);
=20
@@ -607,28 +1090,99 @@
"discard_translations(0x%llx, %lld) req by %s\n",
guest_start, range, who );
=20
- for (sno =3D 0; sno < N_SECTORS; sno++) {
- if (sectors[sno].tc =3D=3D NULL)
- continue;
- for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
- if (sectors[sno].tt[i].status =3D=3D InUse
- && overlaps( guest_start, range, §ors[sno].tt[i].vge ))=
{
- sectors[sno].tt[i].status =3D Deleted;
- sectors[sno].tt_n_inuse--;
- anyDeleted =3D True;
- n_disc_count++;
- n_disc_osize +=3D vge_osize(§ors[sno].tt[i].vge);
- /* Tell the tool too. */
- if (VG_(needs).basic_block_discards) {
- VG_TDICT_CALL( tool_discard_basic_block_info,
- sectors[sno].tt[i].vge );
- }
- }
- } =20
+ /* Pre-deletion sanity check */
+ if (VG_(clo_sanity_level >=3D 4)) {
+ Bool sane =3D sanity_check_all_sectors();
+ vg_assert(sane);
}
=20
+ if (range =3D=3D 0)
+ return;
+
+ /* There are two different ways to do this.
+
+ If the range fits within a single address-range equivalence
+ class, as will be the case for a cache line sized invalidation,
+ then we only have to inspect the set of translations listed in
+ that equivalence class, and also in the "sin-bin" equivalence
+ class ECLASS_MISC.
+
+ Otherwise, the invalidation is of a larger range and probably
+ results from munmap. In this case it's (probably!) faster just
+ to inspect all translations, dump those we don't want, and
+ regenerate the equivalence class information (since modifying it
+ in-situ is even more expensive).
+ */
+
+ /* First off, figure out if the range falls within a single class,=20
+ and if so which one. */
+
+ ec =3D ECLASS_MISC;
+ if (range < (1ULL << ECLASS_SHIFT))
+ ec =3D range_to_eclass( guest_start, (UInt)range );
+
+ /* if ec is ECLASS_MISC then we aren't looking at just a single
+ class, so use the slow scheme. Else use the fast scheme,
+ examining 'ec' and ECLASS_MISC. */
+
+ if (ec !=3D ECLASS_MISC) {
+
+ VG_(debugLog)(2, "transtab",
+ " FAST, ec =3D %d\n", ec);
+
+ /* Fast scheme */
+ vg_assert(ec >=3D 0 && ec < ECLASS_MISC);
+
+ for (sno =3D 0; sno < N_SECTORS; sno++) {
+ sec =3D §ors[sno];
+ if (sec->tc =3D=3D NULL)
+ continue;
+ anyDeleted |=3D delete_translations_in_sector_eclass(=20
+ sec, guest_start, range, ec );
+ anyDeleted |=3D delete_translations_in_sector_eclass(=20
+ sec, guest_start, range, ECLASS_MISC );
+ }
+
+ } else {
+
+ /* slow scheme */
+
+ VG_(debugLog)(2, "transtab",
+ " SLOW, ec =3D %d\n", ec);
+
+ for (sno =3D 0; sno < N_SECTORS; sno++) {
+ sec =3D §ors[sno];
+ if (sec->tc =3D=3D NULL)
+ continue;
+ anyDeleted |=3D delete_translations_in_sector(=20
+ sec, guest_start, range );
+ }
+
+ }
+
if (anyDeleted)
invalidateFastCache();
+
+ /* Post-deletion sanity check */
+ if (VG_(clo_sanity_level >=3D 4)) {
+ Int i;
+ TTEntry* tte;
+ Bool sane =3D sanity_check_all_sectors();
+ vg_assert(sane);
+ /* But now, also check the requested address range isn't
+ present anywhere. */
+ for (sno =3D 0; sno < N_SECTORS; sno++) {
+ sec =3D §ors[sno];
+ if (sec->tc =3D=3D NULL)
+ continue;
+ for (i =3D 0; i < N_TTES_PER_SECTOR; i++) {
+ tte =3D &sec->tt[i];
+ if (tte->status !=3D InUse)
+ continue;
+ vg_assert(!overlaps( guest_start, range, &tte->vge ));
+ }
+ }
+ }
}
=20
=20
@@ -638,7 +1192,7 @@
=20
void VG_(init_tt_tc) ( void )
{
- Int i, avg_codeszQ;
+ Int i, j, avg_codeszQ;
=20
vg_assert(!init_done);
init_done =3D True;
@@ -667,6 +1221,11 @@
sectors[i].tt =3D NULL;
sectors[i].tc_next =3D NULL;
sectors[i].tt_n_inuse =3D 0;
+ for (j =3D 0; j < ECLASS_N; j++) {
+ sectors[i].ec2tte_size[j] =3D 0;
+ sectors[i].ec2tte_used[j] =3D 0;
+ sectors[i].ec2tte[j] =3D NULL;
+ }
}
=20
/* and the fast caches. */
@@ -731,6 +1290,17 @@
VG_(message)(Vg_DebugMsg,
"translate: discarded %,llu (%,llu -> ?" "?)",
n_disc_count, n_disc_osize );
+
+ if (0) {
+ Int i;
+ VG_(printf)("\n");
+ for (i =3D 0; i < ECLASS_N; i++) {
+ VG_(printf)(" %4d", sectors[0].ec2tte_used[i]);
+ if (i % 16 =3D=3D 15)
+ VG_(printf)("\n");
+ }
+ VG_(printf)("\n\n");
+ }
}
=20
/*------------------------------------------------------------*/
|
|
From: Tom H. <th...@cy...> - 2005-10-18 02:28:32
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-10-18 03:15:04 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 == 201 tests, 16 stderr failures, 0 stdout failures ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/mempool (stderr) memcheck/tests/nanoleak (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-10-18 02:22:16
|
Nightly build on dellow ( x86_64, Fedora Core 4 ) started at 2005-10-18 03:10:13 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 == 176 tests, 7 stderr failures, 2 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/as_mmap (stderr) none/tests/as_shm (stdout) none/tests/as_shm (stderr) none/tests/faultstatus (stderr) none/tests/mremap2 (stdout) |
|
From: <sv...@va...> - 2005-10-18 02:20:21
|
Author: sewardj
Date: 2005-10-18 03:20:18 +0100 (Tue, 18 Oct 2005)
New Revision: 4941
Log:
Add a new arena (VG_AR_TTAUX) for holding auxiliary TT/TC structures
(see next commit).
Modified:
trunk/coregrind/m_mallocfree.c
trunk/coregrind/pub_core_mallocfree.h
Modified: trunk/coregrind/m_mallocfree.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_mallocfree.c 2005-10-18 02:15:39 UTC (rev 4940)
+++ trunk/coregrind/m_mallocfree.c 2005-10-18 02:20:18 UTC (rev 4941)
@@ -479,6 +479,7 @@
arena_init ( VG_AR_DEMANGLE, "demangle", 4, 65=
536 );
arena_init ( VG_AR_EXECTXT, "exectxt", 4, 262=
144 );
arena_init ( VG_AR_ERRORS, "errors", 4, 65=
536 );
+ arena_init ( VG_AR_TTAUX, "ttaux", 4, 65=
536 );
nonclient_inited =3D True;
}
=20
Modified: trunk/coregrind/pub_core_mallocfree.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/pub_core_mallocfree.h 2005-10-18 02:15:39 UTC (rev 49=
40)
+++ trunk/coregrind/pub_core_mallocfree.h 2005-10-18 02:20:18 UTC (rev 49=
41)
@@ -48,12 +48,14 @@
DEMANGLE for the C++ demangler.
EXECTXT for storing ExeContexts.
ERRORS for storing CoreErrors.
+ TTAUX for storing TT/TC auxiliary structures (address range
+ equivalence classes).
=20
When adding a new arena, remember also to add it to ensure_mm_init().=
=20
*/
typedef Int ArenaId;
=20
-#define VG_N_ARENAS 7
+#define VG_N_ARENAS 8
=20
#define VG_AR_CORE 0
#define VG_AR_TOOL 1
@@ -62,6 +64,7 @@
#define VG_AR_DEMANGLE 4
#define VG_AR_EXECTXT 5
#define VG_AR_ERRORS 6
+#define VG_AR_TTAUX 7
=20
// This is both the minimum payload size of a malloc'd block, and its
// minimum alignment. Must be a power of 2 greater than 4, and should b=
e
|
|
From: Tom H. <th...@cy...> - 2005-10-18 02:19:53
|
Nightly build on aston ( x86_64, Fedora Core 3 ) started at 2005-10-18 03:05:13 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 == 176 tests, 7 stderr failures, 2 stdout failures ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/as_mmap (stderr) none/tests/as_shm (stdout) none/tests/as_shm (stderr) none/tests/faultstatus (stderr) none/tests/mremap2 (stdout) |
|
From: <sv...@va...> - 2005-10-18 02:15:52
|
Author: sewardj
Date: 2005-10-18 03:15:39 +0100 (Tue, 18 Oct 2005)
New Revision: 4940
Log:
Fix socket stuff on ppc32, so that --log-socket actually works.
Modified:
trunk/coregrind/m_libcfile.c
Modified: trunk/coregrind/m_libcfile.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_libcfile.c 2005-10-16 17:48:09 UTC (rev 4939)
+++ trunk/coregrind/m_libcfile.c 2005-10-18 02:15:39 UTC (rev 4940)
@@ -342,16 +342,24 @@
static=20
UInt my_htonl ( UInt x )
{
+# if defined(VG_BIGENDIAN)
+ return x;
+# else
return
(((x >> 24) & 0xFF) << 0) | (((x >> 16) & 0xFF) << 8)
| (((x >> 8) & 0xFF) << 16) | (((x >> 0) & 0xFF) << 24);
+# endif
}
=20
static
UShort my_htons ( UShort x )
{
+# if defined(VG_BIGENDIAN)
+ return x;
+# else
return
(((x >> 8) & 0xFF) << 0) | (((x >> 0) & 0xFF) << 8);
+# endif
}
=20
=20
@@ -388,16 +396,16 @@
/* create socket */
sd =3D my_socket(VKI_AF_INET, VKI_SOCK_STREAM, 0 /* IPPROTO_IP ? */);
if (sd < 0) {
- /* this shouldn't happen ... nevertheless */
- return -2;
+ /* this shouldn't happen ... nevertheless */
+ return -2;
}
- =09
+ =09
/* connect to server */
res =3D my_connect(sd, (struct vki_sockaddr_in *) &servAddr,=20
sizeof(servAddr));
if (res < 0) {
- /* connection failed */
- return -2;
+ /* connection failed */
+ return -2;
}
=20
return sd;
@@ -501,7 +509,7 @@
error is still returned. */
Int flags =3D VKI_MSG_NOSIGNAL;
=20
-#if defined(VGP_x86_linux)
+#if defined(VGP_x86_linux) || defined(VGP_ppc32_linux)
SysRes res;
UWord args[4];
args[0] =3D sd;
@@ -516,11 +524,6 @@
res =3D VG_(do_syscall6)(__NR_sendto, sd, (UWord)msg, count, flags, 0=
,0);
return res.isError ? -1 : res.val;
=20
-#elif defined(VGP_ppc32_linux)
- //CAB: TODO
- I_die_here;
- flags =3D 0; // stop compiler complaints
-
#else
# error Unknown arch
#endif
|
|
From: Tom H. <th...@cy...> - 2005-10-18 02:15:30
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-10-18 03:00:04 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 == 176 tests, 8 stderr failures, 1 stdout failure ================= memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) none/tests/as_mmap (stderr) none/tests/as_shm (stdout) none/tests/as_shm (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) |