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
(14) |
2
(12) |
3
(14) |
4
(12) |
5
(15) |
6
(12) |
7
(20) |
|
8
(10) |
9
(2) |
10
(8) |
11
(12) |
12
(20) |
13
(12) |
14
(15) |
|
15
(12) |
16
(17) |
17
(16) |
18
(10) |
19
(7) |
20
(7) |
21
(9) |
|
22
(4) |
23
(8) |
24
(4) |
25
|
26
(8) |
27
(5) |
28
(10) |
|
29
(6) |
30
(20) |
31
(9) |
|
|
|
|
|
From: <sv...@va...> - 2015-03-19 22:17:16
|
Author: philippe
Date: Thu Mar 19 22:17:08 2015
New Revision: 15023
Log:
Change TT/TC hashing data structure (decreases memory by 50MB for memcheck 32bits)
This patch changes the way the transtab entries hash table is done.
Currently, the hash table is an open hash table considered full at 65%.
This means that in average, 1 entry on 3 is unused.
(all the hash table memory will be 'active' for big applications,
as the active entries are normally reasonably distributed over the hash table).
The size of a transtab entry is significant (about 150 Bytes).
To avoid having 35% of the entries unused, the translation table
is split in 2:
An hash table, that will contain an index pointing at the transtab entries.
With this technique, we are adding a small hash table,
but we spare 35% of the translation table.
Performance measurements have shown no degradation,
and some platforms have better performance. Not too clear why,
probably this helps platforms with small caches ?).
Modified:
trunk/coregrind/m_transtab.c
Modified: trunk/coregrind/m_transtab.c
==============================================================================
--- trunk/coregrind/m_transtab.c (original)
+++ trunk/coregrind/m_transtab.c Thu Mar 19 22:17:08 2015
@@ -64,12 +64,18 @@
UInt VG_(clo_avg_transtab_entry_size) = 0;
/*------------------ CONSTANTS ------------------*/
-/* Number of TC entries in each sector. This needs to be a prime
- number to work properly, it must be <= 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.
+/* Number of entries in hash table of each sector. This needs to be a prime
+ number to work properly, it must be <= 65535 (so that a TTE index
+ fits in a UShort, leaving room for 0xFFFF(EC2TTE_DELETED, HTT_DELETED)
+ to denote 'deleted') and 0xFFFE (HTT_EMPTY) to denote 'Empty' in the
+ hash table.
+ It is strongly recommended not to change this.
65521 is the largest prime <= 65535. */
-#define N_TTES_PER_SECTOR /*10007*/ /*30011*/ /*40009*/ 65521
+#define N_HTTES_PER_SECTOR /*10007*/ /*30011*/ /*40009*/ 65521
+
+#define EC2TTE_DELETED 0xFFFF /* 16-bit special value */
+#define HTT_DELETED EC2TTE_DELETED
+#define HTT_EMPTY 0XFFFE
/* Because each sector contains a hash table of TTEntries, we need to
specify the maximum allowable loading, after which the sector is
@@ -77,8 +83,8 @@
#define SECTOR_TT_LIMIT_PERCENT 65
/* 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)
+#define N_TTES_PER_SECTOR \
+ ((N_HTTES_PER_SECTOR * SECTOR_TT_LIMIT_PERCENT) / 100)
/* Equivalence classes for fast address range deletion. There are 1 +
2^ECLASS_WIDTH bins. The highest one, ECLASS_MISC, describes an
@@ -89,7 +95,6 @@
#define ECLASS_MISC (1 << ECLASS_WIDTH)
#define ECLASS_N (1 + ECLASS_MISC)
-#define EC2TTE_DELETED 0xFFFF /* 16-bit special value */
/*------------------ TYPES ------------------*/
@@ -139,14 +144,19 @@
auxiliary info too. */
typedef
struct {
- /* Profiling only: the count and weight (arbitrary meaning) for
- this translation. Weight is a property of the translation
- itself and computed once when the translation is created.
- Count is an entry count for the translation and is
- incremented by 1 every time the translation is used, if we
- are profiling. */
- ULong count;
- UShort weight;
+ union {
+ struct {
+ /* Profiling only: the count and weight (arbitrary meaning) for
+ this translation. Weight is a property of the translation
+ itself and computed once when the translation is created.
+ Count is an entry count for the translation and is
+ incremented by 1 every time the translation is used, if we
+ are profiling. */
+ ULong count;
+ UShort weight;
+ } prof; // if status == InUse
+ UInt next_empty_tte; // if status != InUse
+ } usage;
/* Status of the slot. Note, we need to be able to do lazy
deletion, hence the Deleted state. */
@@ -300,7 +310,7 @@
/* Finally, a sector itself. Each sector contains an array of
TCEntries, which hold code, and an array of TTEntries, containing
all required administrative info. Profiling is supported using the
- TTEntry .count and .weight fields, if required.
+ TTEntry usage.prof.count and usage.prof.weight fields, if required.
If the sector is not in use, all three pointers are NULL and
tt_n_inuse is zero.
@@ -313,6 +323,11 @@
its load limit (SECTOR_TT_LIMIT_PERCENT). */
ULong* tc;
+ /* An hash table, mapping guest address to an entry in the tt array.
+ htt is a fixed size, always containing
+ exactly N_HTTES_PER_SECTOR entries. */
+ UInt htt[N_HTTES_PER_SECTOR];
+
/* The TTEntry array. This is a fixed size, always containing
exactly N_TTES_PER_SECTOR entries. */
TTEntry* tt;
@@ -323,6 +338,9 @@
/* The count of tt entries with state InUse. */
Int tt_n_inuse;
+ /* A list of Empty/Deleted entries, chained by tte->next_empty_tte */
+ UInt empty_tt_list;
+
/* 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
@@ -702,7 +720,7 @@
HostExtent* hx = VG_(indexXA)(host_extents, firstW);
UInt tteNo = hx->tteNo;
/* Do some additional sanity checks. */
- vg_assert(tteNo <= N_TTES_PER_SECTOR);
+ vg_assert(tteNo < N_TTES_PER_SECTOR);
/* if this hx entry corresponds to dead host code, we must
tell this code has not been found, as it cannot be patched. */
@@ -1100,7 +1118,7 @@
ULong* tce;
/* Basic checks on this sector */
- if (sec->tt_n_inuse < 0 || sec->tt_n_inuse > N_TTES_PER_SECTOR_USABLE)
+ if (sec->tt_n_inuse < 0 || sec->tt_n_inuse > N_TTES_PER_SECTOR)
BAD("invalid sec->tt_n_inuse");
tce = sec->tc_next;
if (tce < &sec->tc[0] || tce > &sec->tc[tc_sector_szQ])
@@ -1163,7 +1181,7 @@
scan through them and check the TTEntryies they point at point
back. */
- for (i = 0; i < N_TTES_PER_SECTOR_USABLE; i++) {
+ for (i = 0; i < N_TTES_PER_SECTOR; i++) {
tte = &sec->tt[i];
if (tte->status == Empty || tte->status == Deleted) {
@@ -1323,7 +1341,7 @@
UInt ror = 7;
if (ror > 0)
k32 = (k32 >> ror) | (k32 << (32-ror));
- return k32 % N_TTES_PER_SECTOR;
+ return k32 % N_HTTES_PER_SECTOR;
}
static void setFastCacheEntry ( Addr key, ULong* tcptr )
@@ -1356,6 +1374,25 @@
n_fast_flushes++;
}
+
+static UInt get_empty_tt_slot(UInt sNo)
+{
+ UInt i;
+
+ i = sectors[sNo].empty_tt_list;
+ sectors[sNo].empty_tt_list = sectors[sNo].tt[i].usage.next_empty_tte;
+
+ vg_assert (i >= 0 && i < N_TTES_PER_SECTOR);
+
+ return i;
+}
+
+static void add_in_empty_tt_list (UInt sNo, UInt tteno)
+{
+ sectors[sNo].tt[tteno].usage.next_empty_tte = sectors[sNo].empty_tt_list;
+ sectors[sNo].empty_tt_list = tteno;
+}
+
static void initialiseSector ( Int sno )
{
Int i;
@@ -1401,11 +1438,14 @@
/*NOTREACHED*/
}
sec->tt = (TTEntry*)(Addr)sr_Res(sres);
-
+ sec->empty_tt_list = HTT_EMPTY;
for (i = 0; i < N_TTES_PER_SECTOR; i++) {
sec->tt[i].status = Empty;
sec->tt[i].n_tte2ec = 0;
+ add_in_empty_tt_list(sno, i);
}
+ for (i = 0; i < N_HTTES_PER_SECTOR; i++)
+ sec->htt[i] = HTT_EMPTY;
/* Set up the host_extents array. */
sec->host_extents
@@ -1444,6 +1484,7 @@
/* Visit each just-about-to-be-abandoned translation. */
if (DEBUG_TRANSTAB) VG_(printf)("QQQ unlink-entire-sector: %d START\n",
sno);
+ sec->empty_tt_list = HTT_EMPTY;
for (i = 0; i < N_TTES_PER_SECTOR; i++) {
if (sec->tt[i].status == InUse) {
vg_assert(sec->tt[i].n_tte2ec >= 1);
@@ -1462,7 +1503,11 @@
}
sec->tt[i].status = Empty;
sec->tt[i].n_tte2ec = 0;
+ add_in_empty_tt_list(sno, i);
}
+ for (i = 0; i < N_HTTES_PER_SECTOR; i++)
+ sec->htt[i] = HTT_EMPTY;
+
if (DEBUG_TRANSTAB) VG_(printf)("QQQ unlink-entire-sector: %d END\n",
sno);
@@ -1507,7 +1552,6 @@
}
}
-
/* Add a translation of vge to TT/TC. The translation is temporarily
in code[0 .. code_len-1].
@@ -1562,14 +1606,14 @@
vg_assert(tcAvailQ <= tc_sector_szQ);
if (tcAvailQ < reqdQ
- || sectors[y].tt_n_inuse >= N_TTES_PER_SECTOR_USABLE) {
+ || sectors[y].tt_n_inuse >= N_TTES_PER_SECTOR) {
/* No. So move on to the next sector. Either it's never been
used before, in which case it will get its tt/tc allocated
now, or it has been used before, in which case it is set to be
empty, hence throwing out the oldest sector. */
vg_assert(tc_sector_szQ > 0);
Int tt_loading_pct = (100 * sectors[y].tt_n_inuse)
- / N_TTES_PER_SECTOR;
+ / N_HTTES_PER_SECTOR;
Int tc_loading_pct = (100 * (tc_sector_szQ - tcAvailQ))
/ tc_sector_szQ;
if (VG_(clo_stats) || VG_(debugLog_getLevel)() >= 1) {
@@ -1592,7 +1636,7 @@
vg_assert(tcAvailQ >= 0);
vg_assert(tcAvailQ <= tc_sector_szQ);
vg_assert(tcAvailQ >= reqdQ);
- vg_assert(sectors[y].tt_n_inuse < N_TTES_PER_SECTOR_USABLE);
+ vg_assert(sectors[y].tt_n_inuse < N_TTES_PER_SECTOR);
vg_assert(sectors[y].tt_n_inuse >= 0);
/* Copy into tc. */
@@ -1613,25 +1657,29 @@
/* Find an empty tt slot, and use it. There must be such a slot
since tt is never allowed to get completely full. */
- i = HASH_TT(entry);
- vg_assert(i >= 0 && i < N_TTES_PER_SECTOR);
- while (True) {
- if (sectors[y].tt[i].status == Empty
- || sectors[y].tt[i].status == Deleted)
- break;
- i++;
- if (i >= N_TTES_PER_SECTOR)
- i = 0;
- }
-
+ i = get_empty_tt_slot(y);
TTEntry__init(§ors[y].tt[i]);
sectors[y].tt[i].status = InUse;
sectors[y].tt[i].tcptr = tcptr;
- sectors[y].tt[i].count = 0;
- sectors[y].tt[i].weight = n_guest_instrs == 0 ? 1 : n_guest_instrs;
+ sectors[y].tt[i].usage.prof.count = 0;
+ sectors[y].tt[i].usage.prof.weight =
+ n_guest_instrs == 0 ? 1 : n_guest_instrs;
sectors[y].tt[i].vge = *vge;
sectors[y].tt[i].entry = entry;
+ // Point an htt entry to the tt slot
+ UInt htti = HASH_TT(entry);
+ vg_assert(htti >= 0 && htti < N_HTTES_PER_SECTOR);
+ while (True) {
+ if (sectors[y].htt[htti] == HTT_EMPTY
+ || sectors[y].htt[htti] == HTT_DELETED)
+ break;
+ htti++;
+ if (htti >= N_HTTES_PER_SECTOR)
+ htti = 0;
+ }
+ sectors[y].htt[htti] = i;
+
/* Patch in the profile counter location, if necessary. */
if (offs_profInc != -1) {
vg_assert(offs_profInc >= 0 && offs_profInc < code_len);
@@ -1643,7 +1691,7 @@
VexInvalRange vir
= LibVEX_PatchProfInc( arch_host, endness_host,
dstP + offs_profInc,
- §ors[y].tt[i].count );
+ §ors[y].tt[i].usage.prof.count );
VG_(invalidate_icache)( (void*)vir.start, vir.len );
}
@@ -1688,6 +1736,7 @@
Bool upd_cache )
{
Int i, j, k, kstart, sno;
+ UInt tti;
vg_assert(init_done);
/* Find the initial probe point just once. It will be the same in
@@ -1695,7 +1744,7 @@
n_full_lookups++;
k = -1;
kstart = HASH_TT(guest_addr);
- vg_assert(kstart >= 0 && kstart < N_TTES_PER_SECTOR);
+ vg_assert(kstart >= 0 && kstart < N_HTTES_PER_SECTOR);
/* Search in all the sectors,using sector_search_order[] as a
heuristic guide as to what order to visit the sectors. */
@@ -1706,20 +1755,21 @@
return False; /* run out of sectors to search */
k = kstart;
- for (j = 0; j < N_TTES_PER_SECTOR; j++) {
+ for (j = 0; j < N_HTTES_PER_SECTOR; j++) {
n_lookup_probes++;
- if (sectors[sno].tt[k].status == InUse
- && sectors[sno].tt[k].entry == guest_addr) {
+ tti = sectors[sno].htt[k];
+ if (tti < N_TTES_PER_SECTOR
+ && sectors[sno].tt[tti].entry == guest_addr) {
/* found it */
if (upd_cache)
setFastCacheEntry(
- guest_addr, sectors[sno].tt[k].tcptr );
+ guest_addr, sectors[sno].tt[tti].tcptr );
if (res_hcode)
- *res_hcode = (Addr)sectors[sno].tt[k].tcptr;
+ *res_hcode = (Addr)sectors[sno].tt[tti].tcptr;
if (res_sNo)
*res_sNo = sno;
if (res_tteNo)
- *res_tteNo = k;
+ *res_tteNo = tti;
/* pull this one one step closer to the front. For large
apps this more or less halves the number of required
probes. */
@@ -1730,10 +1780,11 @@
}
return True;
}
- if (sectors[sno].tt[k].status == Empty)
+ // tti is HTT_EMPTY or HTT_DELETED or not the entry of guest_addr
+ if (sectors[sno].htt[k] == HTT_EMPTY)
break; /* not found in this sector */
k++;
- if (k == N_TTES_PER_SECTOR)
+ if (k == N_HTTES_PER_SECTOR)
k = 0;
}
@@ -1818,8 +1869,25 @@
}
/* Now fix up this TTEntry. */
+ /* Mark the entry as deleted in htt.
+ Note: we could avoid the below hash table search by
+ adding a reference from tte to its hash position in tt. */
+ UInt kstart = HASH_TT(tte->entry);
+ UInt k = kstart;
+ UInt j;
+ vg_assert(kstart >= 0 && kstart < N_HTTES_PER_SECTOR);
+ for (j = 0; j < N_HTTES_PER_SECTOR; j++) {
+ if (sec->htt[k] == tteno)
+ break;
+ k++;
+ if (k == N_HTTES_PER_SECTOR)
+ k = 0;
+ }
+ vg_assert(j < N_HTTES_PER_SECTOR);
+ sec->htt[k] = HTT_DELETED;
tte->status = Deleted;
tte->n_tte2ec = 0;
+ add_in_empty_tt_list(secNo, tteno);
/* Stats .. */
sec->tt_n_inuse--;
@@ -2231,11 +2299,11 @@
avg_codeszQ = (VG_(details).avg_translation_sizeB + 7) / 8;
else
avg_codeszQ = (VG_(clo_avg_transtab_entry_size) + 7) / 8;
- tc_sector_szQ = N_TTES_PER_SECTOR_USABLE * (1 + avg_codeszQ);
+ tc_sector_szQ = N_TTES_PER_SECTOR * (1 + avg_codeszQ);
/* Ensure the calculated value is not way crazy. */
- vg_assert(tc_sector_szQ >= 2 * N_TTES_PER_SECTOR_USABLE);
- vg_assert(tc_sector_szQ <= 100 * N_TTES_PER_SECTOR_USABLE);
+ vg_assert(tc_sector_szQ >= 2 * N_TTES_PER_SECTOR);
+ vg_assert(tc_sector_szQ <= 100 * N_TTES_PER_SECTOR);
n_sectors = VG_(clo_num_transtab_sectors);
vg_assert(n_sectors >= MIN_N_SECTORS);
@@ -2268,20 +2336,24 @@
VG_(clo_avg_transtab_entry_size) == 0 ? "using " : "ignoring ",
VG_(details).avg_translation_sizeB);
VG_(message)(Vg_DebugMsg,
- "TT/TC: cache: %d sectors of %d bytes each = %d total\n",
+ "TT/TC: cache: %d sectors of %d bytes each = %d total TC\n",
n_sectors, 8 * tc_sector_szQ,
n_sectors * 8 * tc_sector_szQ );
VG_(message)(Vg_DebugMsg,
- "TT/TC: table: %d tables of %d bytes each = %d total\n",
- n_sectors, (int)(N_TTES_PER_SECTOR * sizeof(TTEntry)),
+ "TT/TC: table: %d tables[%d] of %d bytes each = %d total TT\n",
+ n_sectors, N_TTES_PER_SECTOR,
+ (int)(N_TTES_PER_SECTOR * sizeof(TTEntry)),
(int)(n_sectors * N_TTES_PER_SECTOR * sizeof(TTEntry)));
VG_(message)(Vg_DebugMsg,
- "TT/TC: table: %d entries each = %d total entries"
- " max occupancy %d (%d%%)\n",
- N_TTES_PER_SECTOR,
- n_sectors * N_TTES_PER_SECTOR,
- n_sectors * N_TTES_PER_SECTOR_USABLE,
- SECTOR_TT_LIMIT_PERCENT );
+ "TT/TC: table: %d tt entries each = %d total tt entries\n",
+ N_TTES_PER_SECTOR, n_sectors * N_TTES_PER_SECTOR);
+ VG_(message)(Vg_DebugMsg,
+ "TT/TC: table: %d htt[%d] of %d bytes each = %d total HTT"
+ " (htt[%d] %d%% max occup)\n",
+ n_sectors, N_HTTES_PER_SECTOR,
+ (int)(N_HTTES_PER_SECTOR * sizeof(UInt)),
+ (int)(n_sectors * N_HTTES_PER_SECTOR * sizeof(UInt)),
+ N_HTTES_PER_SECTOR, SECTOR_TT_LIMIT_PERCENT);
}
}
@@ -2343,7 +2415,7 @@
static ULong score ( const TTEntry* tte )
{
- return ((ULong)tte->weight) * ((ULong)tte->count);
+ return ((ULong)tte->usage.prof.weight) * ((ULong)tte->usage.prof.count);
}
ULong VG_(get_SB_profile) ( SBProfEntry tops[], UInt n_tops )
@@ -2405,7 +2477,7 @@
for (i = 0; i < N_TTES_PER_SECTOR; i++) {
if (sectors[sno].tt[i].status != InUse)
continue;
- sectors[sno].tt[i].count = 0;
+ sectors[sno].tt[i].usage.prof.count = 0;
}
}
|
|
From: Julian S. <js...@ac...> - 2015-03-19 14:46:26
|
Hi, I created a new email list, val...@li..., with the intention that nightly auto-build results can be sent to it rather than to this list. The auto-build results have tended to clog up this list and IMO discourage people from using it for general dev discussions -- certainly it discourages me. So the new list is an attempt to fix that. If you run a nightly builder, please subscribe to val...@li... which you can do at https://lists.sourceforge.net/lists/listinfo/valgrind-testresults and get your builder to send results to it instead of this list. If you are hacking on the sources, please consider subscribing to the new list, so you can see test results. Thanks! J |
|
From: Julian S. <js...@ac...> - 2015-03-19 14:37:51
|
Carl, > We had a bug reported against valgrind because the AT_DCACHEBSIZE was > not being passed to the user application. The following patch adds the > AT_DCACHEBSIZE and HWCAP2 to the recognized aux vector entries for PPC64 > LE and BE. I am not very familiar with the aux vector stuff so I would > like to get an additional review of the patch. It looks plausible, yes. > If an aux vector value is not know, the default is to suppress it. I > was wondering why? I think that's paranoia from the very early days of the project. I don't really know. I'd prefer to stick with this scheme though, so that we don't unwittingly pass AT_ entries to the application that have some bad effect that we don't know about. > Also, as noted in the comment, it would be good to verify the > valgrind hwcaps has the 2_07 flag set. Yes I agree. At m_main.c:1835, vex_arch/vex_archinfo are filled in. At line 1948 there is a call to VG_(ii_create_image) which in turn calls through to setup_client_stack, which contains the switch you were looking at. You could pass a pointer to vex_arch/vex_archinfo (whichever of those are necessary, maybe both) though VG_(ii_create_image) to setup_client_stack. Would that work? You'd need to pull vex_arch/vex_archinfo out of their local scope, but that's no big deal. J |
|
From: Andres T. <and...@ta...> - 2015-03-19 12:32:26
|
Hi, I'm having troubles wrapping functions from pthread.
I made a very simple tool fo valgrind-3.10.1 that just wraps
pthread_create but I can't make it work and I don't know why.
The tool has just 2 files: fb_main.c and fb_intercept.c
------------------------------fb_main.c-----------------------------------------------
#include "pub_tool_tooliface.h"
static void fb_post_clo_init(void)
{
}
static IRSB* fb_instrument ( VgCallbackClosure* closure,
IRSB* bb,
const VexGuestLayout* layout,
const VexGuestExtents* vge,
const VexArchInfo* archinfo_host,
IRType gWordTy, IRType hWordTy )
{
return bb;
}
static void fb_fini(Int exitcode)
{
}
static void fb_pre_clo_init(void)
{
VG_(details_name) ("Nulgrind");
VG_(details_version) (NULL);
VG_(details_description) ("the minimal Valgrind tool");
VG_(details_copyright_author)(
"Copyright (C) 2002-2013, and GNU GPL'd, by Nicholas Nethercote.");
VG_(details_bug_reports_to) (VG_BUGS_TO);
VG_(basic_tool_funcs) (fb_post_clo_init,
fb_instrument,
fb_fini);
VG_(needs_core_errors) ();
}
VG_DETERMINE_INTERFACE_VERSION(fb_pre_clo_init)
-------------------------------------------------------------------------------------------------------
and
--------------------------------- fb_intercept.c
--------------------------------------------------
#include "pub_tool_basics.h"
#include "pub_tool_redir.h"
#include "pub_tool_clreq.h"
#include "valgrind.h"
#include "config.h"
#include <pthread.h>
int I_WRAP_SONAME_FNNAME_ZZ(libpthreadZdsoZd0, pthreadZucreateZAZa)
(pthread_t *thread, const pthread_attr_t *attr, void *(*start)
(void *), void *arg)
{
int result = 1;
OrigFn fn;
VALGRIND_GET_ORIG_FN(fn);
CALL_FN_W_WWWW(result, fn, thread, attr, start, arg);
return result;
}
-------------------------------------------------------------------------------------------------------------------
But when I try to run a program tah uses pthread I'm getting this:
----------------------------------------------------------------------------------------------------------
==6540== Nulgrind, the minimal Valgrind tool
==6540== Copyright (C) 2002-2013, and GNU GPL'd, by Nicholas Nethercote.
==6540== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==6540== Command: ../prueba/a.out
==6540==
--6540-- VG_USERREQ__CLIENT_CALL2: func=0x0
==6540==
==6540== Process terminating with default action of signal 11 (SIGSEGV)
==6540== Access not within mapped region at address 0x10
==6540== at 0x35006084D1: pthread_create@@GLIBC_2.2.5 (in
/usr/lib64/libpthread-2.18.so)
==6540== by 0x4A077CD: pthread_create@* (fb_intercept.c:42)
==6540== by 0x4008D1: main (in /home/andres/Documents/valgrind/prueba/a.out)
==6540== If you believe this happened as a result of a stack
==6540== overflow in your program's main thread (unlikely but
==6540== possible), you can try to increase the size of the
==6540== main thread stack using the --main-stacksize= flag.
==6540== The main thread stack size used in this run was 8388608.
==6540==
==6540== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
Segmentation fault (core dumped)
-----------------------------------------------------------------------------------------------------------
If I comment the "CALL_FN_W_WWWW()" in fb_intercept.c when I wrap
pthread_create, there are no problems, just pthread_create doesn't
work properly as expected.
I have not a single clue what's going on but maybe someone can help me
know what I'm doing wrong.
ps:I'm working in fedora 20 and ubuntu 14.04
Regards,
Andrés.
|
Author: mjw
Date: Thu Mar 19 11:27:46 2015
New Revision: 15022
Log:
Add nightly script for wildebeest[32] (debian x86), lfedora1 (fedora s390x)
Added:
trunk/nightly/conf/lfedora1.conf
trunk/nightly/conf/lfedora1.sendmail (with props)
trunk/nightly/conf/wildebeest.conf
trunk/nightly/conf/wildebeest.sendmail (with props)
trunk/nightly/conf/wildebeest32.conf
trunk/nightly/conf/wildebeest32.sendmail (with props)
Added: trunk/nightly/conf/lfedora1.conf
==============================================================================
--- trunk/nightly/conf/lfedora1.conf (added)
+++ trunk/nightly/conf/lfedora1.conf Thu Mar 19 11:27:46 2015
@@ -0,0 +1,3 @@
+export ABT_DETAILS="`cat /etc/fedora-release`, `uname -m`"
+export ABT_JOBS=2
+#export ABT_PERF="--vg=../valgrind-new --vg=../valgrind-old"
Added: trunk/nightly/conf/lfedora1.sendmail
==============================================================================
--- trunk/nightly/conf/lfedora1.sendmail (added)
+++ trunk/nightly/conf/lfedora1.sendmail Thu Mar 19 11:27:46 2015
@@ -0,0 +1,19 @@
+subject="$1"
+summary="$2"
+diffs="$3"
+
+# Note this drops the mail as file to be picked up by another script
+# that will actually sent it (this machine cannot directly sent email).
+MAILFILE="$HOME/valgrind-results/$(date +%d-%b-%Y.%R)"
+
+echo "Subject: $subject" >> $MAILFILE
+echo "To: val...@li..." >> $MAILFILE
+echo "Bcc: val...@wi..." >> $MAILFILE
+echo " " >> $MAILFILE
+cat "$summary" >> $MAILFILE
+echo " " >> $MAILFILE
+cat "$diffs" >> $MAILFILE
+
+MAILLATEST="$HOME/valgrind-results/latest"
+rm -f $MAILLATEST
+ln -s $MAILFILE $MAILLATEST
Added: trunk/nightly/conf/wildebeest.conf
==============================================================================
--- trunk/nightly/conf/wildebeest.conf (added)
+++ trunk/nightly/conf/wildebeest.conf Thu Mar 19 11:27:46 2015
@@ -0,0 +1,3 @@
+export ABT_DETAILS="`lsb_release -sicr | xargs echo` `uname -m`"
+export ABT_JOBS=2
+#export ABT_PERF="--vg=../valgrind-new --vg=../valgrind-old"
Added: trunk/nightly/conf/wildebeest.sendmail
==============================================================================
--- trunk/nightly/conf/wildebeest.sendmail (added)
+++ trunk/nightly/conf/wildebeest.sendmail Thu Mar 19 11:27:46 2015
@@ -0,0 +1,16 @@
+subject="$1"
+summary="$2"
+diffs="$3"
+
+MAILFILE="/usr/local/build/valgrind/results/$(date +%d-%b-%Y.%R)"
+
+echo "Subject: $subject" > $MAILFILE
+echo "To: val...@li..." >> $MAILFILE
+echo "Bcc: val...@wi..." >> $MAILFILE
+echo >> $MAILFILE
+
+cat "$summary" >> $MAILFILE
+echo " " >> $MAILFILE
+cat "$diffs" >> $MAILFILE
+
+/usr/sbin/sendmail -t -i -f...@bu... < $MAILFILE
Added: trunk/nightly/conf/wildebeest32.conf
==============================================================================
--- trunk/nightly/conf/wildebeest32.conf (added)
+++ trunk/nightly/conf/wildebeest32.conf Thu Mar 19 11:27:46 2015
@@ -0,0 +1,3 @@
+export ABT_DETAILS="`lsb_release -sicr | xargs echo` `uname -m`"
+export ABT_JOBS=2
+#export ABT_PERF="--vg=../valgrind-new --vg=../valgrind-old"
Added: trunk/nightly/conf/wildebeest32.sendmail
==============================================================================
--- trunk/nightly/conf/wildebeest32.sendmail (added)
+++ trunk/nightly/conf/wildebeest32.sendmail Thu Mar 19 11:27:46 2015
@@ -0,0 +1,16 @@
+subject="$1"
+summary="$2"
+diffs="$3"
+
+MAILFILE="/usr/local/build/valgrind/results/$(date +%d-%b-%Y.%R)"
+
+echo "Subject: $subject" > $MAILFILE
+echo "To: val...@li..." >> $MAILFILE
+echo "Bcc: val...@wi..." >> $MAILFILE
+echo >> $MAILFILE
+
+cat "$summary" >> $MAILFILE
+echo " " >> $MAILFILE
+cat "$diffs" >> $MAILFILE
+
+/usr/sbin/sendmail -t -i -f...@bu... < $MAILFILE
|
|
From: <ma...@bu...> - 2015-03-19 10:57:04
|
valgrind revision: 15021
VEX revision: 3104
C compiler: gcc (Debian 4.7.2-5) 4.7.2
GDB: GNU gdb (GDB) 7.4.1-debian
Assembler: GNU assembler (GNU Binutils for Debian) 2.22
C library: GNU C Library (Debian EGLIBC 2.13-38+deb7u8) stable release version 2.13
uname -mrs: Linux 3.2.0-4-amd64 x86_64
Vendor version: Debian GNU/Linux 7 (wheezy)
Nightly build on wildebeest ( Debian 7.8 wheezy x86_64 )
Started at 2015-03-18 00:00:01 UTC
Ended at 2015-03-18 01:15:12 UTC
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
== 689 tests, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
=================================================
== 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
== 689 tests, 1 stderr failure, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
helgrind/tests/pth_destroy_cond (stderr)
=================================================
== Difference between 24 hours ago and now ==
=================================================
*** old.short 2015-03-18 00:36:35.351430038 +0000
--- new.short 2015-03-18 01:15:12.133150204 +0000
***************
*** 8,11 ****
! == 689 tests, 1 stderr failure, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
! helgrind/tests/pth_destroy_cond (stderr)
--- 8,10 ----
! == 689 tests, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
=================================================
./valgrind-old/helgrind/tests/pth_destroy_cond.stderr.diff
=================================================
--- pth_destroy_cond.stderr.exp 2015-03-18 00:00:20.306752387 +0000
+++ pth_destroy_cond.stderr.out 2015-03-18 00:24:01.686998758 +0000
@@ -5,6 +5,34 @@
by 0x........: pthread_create@* (hg_intercepts.c:...)
by 0x........: main (pth_destroy_cond.c:29)
+---Thread-Announcement------------------------------------------
+
+Thread #x is the program's root thread
+
+----------------------------------------------------------------
+
+ Lock at 0x........ was first observed
+ at 0x........: pthread_mutex_init (hg_intercepts.c:...)
+ by 0x........: main (pth_destroy_cond.c:25)
+ Address 0x........ is 0 bytes inside data symbol "mutex"
+
+Possible data race during read of size 1 at 0x........ by thread #x
+Locks held: 1, at address 0x........
+ at 0x........: my_memcmp (hg_intercepts.c:...)
+ by 0x........: pthread_cond_destroy_WRK (hg_intercepts.c:...)
+ by 0x........: pthread_cond_destroy@* (hg_intercepts.c:...)
+ by 0x........: ThreadFunction (pth_destroy_cond.c:18)
+ by 0x........: mythread_wrapper (hg_intercepts.c:...)
+ ...
+
+This conflicts with a previous write of size 4 by thread #x
+Locks held: none
+ ...
+ by 0x........: pthread_cond_wait_WRK (hg_intercepts.c:...)
+ by 0x........: pthread_cond_wait@* (hg_intercepts.c:...)
+ by 0x........: main (pth_destroy_cond.c:31)
+ Address 0x........ is 4 bytes inside data symbol "cond"
+
----------------------------------------------------------------
Thread #x: pthread_cond_destroy: destruction of condition variable being waited upon
|
|
From: Mark W. <ma...@bu...> - 2015-03-19 10:56:00
|
valgrind revision: 15021
VEX revision: 3104
C compiler: gcc (Debian 4.7.2-5) 4.7.2
GDB: GNU gdb (GDB) 7.4.1-debian
Assembler: GNU assembler (GNU Binutils for Debian) 2.22
C library: GNU C Library (Debian EGLIBC 2.13-38+deb7u8) stable release version 2.13
uname -mrs: Linux 3.2.0-4-686-pae i686
Vendor version: Debian GNU/Linux 7 (wheezy)
Nightly build on wildebeest32 ( Debian 7.8 wheezy i686 )
Started at 2015-03-18 02:07:01 CET
Ended at 2015-03-18 03:49:56 CET
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
== 633 tests, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
=================================================
== Results from 24 hours ago ==
=================================================
Checking out valgrind source tree ... done
Configuring valgrind ... done
Building valgrind ... done
Running regression tests ... done
Regression test results follow
== 633 tests, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
=================================================
== Difference between 24 hours ago and now ==
=================================================
*** old.short 2015-03-18 03:04:40.747702998 +0100
--- new.short 2015-03-18 03:49:56.935703002 +0100
***************
*** 4,6 ****
Building valgrind ... done
! Running regression tests ... done
--- 4,6 ----
Building valgrind ... done
! Running regression tests ... failed
Congratulations, all tests passed!
|