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
(21) |
|
2
(19) |
3
(33) |
4
(24) |
5
(18) |
6
(13) |
7
(22) |
8
(21) |
|
9
(38) |
10
(25) |
11
(20) |
12
(27) |
13
(43) |
14
(9) |
15
(19) |
|
16
(37) |
17
(19) |
18
(13) |
19
(11) |
20
(8) |
21
(11) |
22
(25) |
|
23
(21) |
24
(30) |
25
(18) |
26
(11) |
27
(10) |
28
(14) |
29
(40) |
|
30
(24) |
31
(14) |
|
|
|
|
|
|
From: Bart V. A. <bar...@gm...> - 2008-03-21 18:16:49
|
By running the exp-drd regression tests on different Linux platforms I found out that some shells redirect abnormal termination messages if stderr is redirected and some do not. This can cause regression tests to fail while they should not. The patch below fixes this. Comments are welcome. If I do not receive any comments, I will apply this patch next week. Bart. Index: tests/filter_stderr_basic =================================================================== --- tests/filter_stderr_basic (revision 7740) +++ tests/filter_stderr_basic (working copy) @@ -41,6 +41,12 @@ # Remove line info out of order warnings sed "/warning: line info addresses out of order/d" | +# Older bash versions print abnormal termination messages on the stderr +# of the bash process. Newer bash versions redirect such messages properly. +# Suppress any redirected abnormal termination messages. You can find the +# complete list of messages in the bash source file siglist.c. +sed -r "/^(Segmentation fault|Alarm clock|Aborted)( \(core dumped\))?$/d" | + # Remove any ": dumping core" message as the user might have a # limit set that prevents the core dump sed "s/\(signal [0-9]* (SIG[A-Z]*)\): dumping core/\1/" |
|
From: Bart V. A. <bar...@gm...> - 2008-03-21 17:11:38
|
On Fri, Mar 21, 2008 at 10:08 AM, Nicholas Nethercote
<nj...@cs...> wrote:
>
> The idea seems ok to me. I'd probably put it in pub_tool_basics.h, though.
> It would be good if the various other macros were changed to use this one, too.
By this time I have reworked the patch -- see also below. Any feedback
is welcome.
Bart.
Index: helgrind/hg_main.c
===================================================================
--- helgrind/hg_main.c (revision 7742)
+++ helgrind/hg_main.c (working copy)
@@ -226,15 +226,7 @@
/* Round a down to the next multiple of N. N must be a power of 2 */
#define ROUNDDN(a, N) ((a) & ~(N-1))
-#ifdef HAVE_BUILTIN_EXPECT
-#define LIKELY(cond) __builtin_expect(!!(cond),1)
-#define UNLIKELY(cond) __builtin_expect(!!(cond),0)
-#else
-#define LIKELY(cond) (cond)
-#define UNLIKELY(cond) (cond)
-#endif
-
/*----------------------------------------------------------------*/
/*--- Primary data definitions ---*/
/*----------------------------------------------------------------*/
Index: memcheck/mc_main.c
===================================================================
--- memcheck/mc_main.c (revision 7742)
+++ memcheck/mc_main.c (working copy)
@@ -49,13 +49,6 @@
#include "mc_include.h"
#include "memcheck.h" /* for client requests */
-#ifdef HAVE_BUILTIN_EXPECT
-#define EXPECTED_TAKEN(cond) __builtin_expect((cond),1)
-#define EXPECTED_NOT_TAKEN(cond) __builtin_expect((cond),0)
-#else
-#define EXPECTED_TAKEN(cond) (cond)
-#define EXPECTED_NOT_TAKEN(cond) (cond)
-#endif
/* Set to 1 to do a little more sanity checking */
#define VG_DEBUG_MEMORY 0
@@ -503,9 +496,9 @@
/* First search the front-cache, which is a self-organising
list containing the most popular entries. */
- if (EXPECTED_TAKEN(auxmap_L1[0].base == a))
+ if (LIKELY(auxmap_L1[0].base == a))
return auxmap_L1[0].ent;
- if (EXPECTED_TAKEN(auxmap_L1[1].base == a)) {
+ if (LIKELY(auxmap_L1[1].base == a)) {
Addr t_base = auxmap_L1[0].base;
AuxMapEnt* t_ent = auxmap_L1[0].ent;
auxmap_L1[0].base = auxmap_L1[1].base;
@@ -557,7 +550,7 @@
/* First see if we already have it. */
res = maybe_find_in_auxmap( a );
- if (EXPECTED_TAKEN(res))
+ if (LIKELY(res))
return res;
/* Ok, there's no entry in the secondary map, so we'll have
@@ -614,7 +607,7 @@
static INLINE SecMap* get_secmap_for_writing_low(Addr a)
{
SecMap** p = get_secmap_low_ptr(a);
- if (EXPECTED_NOT_TAKEN(is_distinguished_sm(*p)))
+ if (UNLIKELY(is_distinguished_sm(*p)))
*p = copy_for_writing(*p);
return *p;
}
@@ -622,7 +615,7 @@
static INLINE SecMap* get_secmap_for_writing_high ( Addr a )
{
SecMap** p = get_secmap_high_ptr(a);
- if (EXPECTED_NOT_TAKEN(is_distinguished_sm(*p)))
+ if (UNLIKELY(is_distinguished_sm(*p)))
*p = copy_for_writing(*p);
return *p;
}
@@ -1029,7 +1022,7 @@
static INLINE Bool in_ignored_range ( Addr a )
{
Int i;
- if (EXPECTED_TAKEN(ignoreRanges.used == 0))
+ if (LIKELY(ignoreRanges.used == 0))
return False;
for (i = 0; i < ignoreRanges.used; i++) {
if (a >= ignoreRanges.start[i] && a < ignoreRanges.end[i])
@@ -1174,25 +1167,25 @@
folded out by compilers on 32-bit platforms. These are derived
from LOADV64 and LOADV32.
*/
- if (EXPECTED_TAKEN(sizeof(void*) == 8
+ if (LIKELY(sizeof(void*) == 8
&& nBits == 64 && VG_IS_8_ALIGNED(a))) {
SecMap* sm = get_secmap_for_reading(a);
UWord sm_off16 = SM_OFF_16(a);
UWord vabits16 = ((UShort*)(sm->vabits8))[sm_off16];
- if (EXPECTED_TAKEN(vabits16 == VA_BITS16_DEFINED))
+ if (LIKELY(vabits16 == VA_BITS16_DEFINED))
return V_BITS64_DEFINED;
- if (EXPECTED_TAKEN(vabits16 == VA_BITS16_UNDEFINED))
+ if (LIKELY(vabits16 == VA_BITS16_UNDEFINED))
return V_BITS64_UNDEFINED;
/* else fall into the slow case */
}
- if (EXPECTED_TAKEN(sizeof(void*) == 8
+ if (LIKELY(sizeof(void*) == 8
&& nBits == 32 && VG_IS_4_ALIGNED(a))) {
SecMap* sm = get_secmap_for_reading(a);
UWord sm_off = SM_OFF(a);
UWord vabits8 = sm->vabits8[sm_off];
- if (EXPECTED_TAKEN(vabits8 == VA_BITS8_DEFINED))
+ if (LIKELY(vabits8 == VA_BITS8_DEFINED))
return ((UWord)0xFFFFFFFF00000000ULL | (UWord)V_BITS32_DEFINED);
- if (EXPECTED_TAKEN(vabits8 == VA_BITS8_UNDEFINED))
+ if (LIKELY(vabits8 == VA_BITS8_UNDEFINED))
return ((UWord)0xFFFFFFFF00000000ULL | (UWord)V_BITS32_UNDEFINED);
/* else fall into slow case */
}
@@ -1256,18 +1249,18 @@
folded out by compilers on 32-bit platforms. These are derived
from STOREV64 and STOREV32.
*/
- if (EXPECTED_TAKEN(sizeof(void*) == 8
+ if (LIKELY(sizeof(void*) == 8
&& nBits == 64 && VG_IS_8_ALIGNED(a))) {
SecMap* sm = get_secmap_for_reading(a);
UWord sm_off16 = SM_OFF_16(a);
UWord vabits16 = ((UShort*)(sm->vabits8))[sm_off16];
- if (EXPECTED_TAKEN( !is_distinguished_sm(sm) &&
+ if (LIKELY( !is_distinguished_sm(sm) &&
(VA_BITS16_DEFINED == vabits16 ||
VA_BITS16_UNDEFINED == vabits16) )) {
/* Handle common case quickly: a is suitably aligned, */
/* is mapped, and is addressible. */
// Convert full V-bits in register to compact 2-bit form.
- if (EXPECTED_TAKEN(V_BITS64_DEFINED == vbytes)) {
+ if (LIKELY(V_BITS64_DEFINED == vbytes)) {
((UShort*)(sm->vabits8))[sm_off16] = (UShort)VA_BITS16_DEFINED;
return;
} else if (V_BITS64_UNDEFINED == vbytes) {
@@ -1278,18 +1271,18 @@
}
/* else fall into the slow case */
}
- if (EXPECTED_TAKEN(sizeof(void*) == 8
+ if (LIKELY(sizeof(void*) == 8
&& nBits == 32 && VG_IS_4_ALIGNED(a))) {
SecMap* sm = get_secmap_for_reading(a);
UWord sm_off = SM_OFF(a);
UWord vabits8 = sm->vabits8[sm_off];
- if (EXPECTED_TAKEN( !is_distinguished_sm(sm) &&
+ if (LIKELY( !is_distinguished_sm(sm) &&
(VA_BITS8_DEFINED == vabits8 ||
VA_BITS8_UNDEFINED == vabits8) )) {
/* Handle common case quickly: a is suitably aligned, */
/* is mapped, and is addressible. */
// Convert full V-bits in register to compact 2-bit form.
- if (EXPECTED_TAKEN(V_BITS32_DEFINED == (vbytes & 0xFFFFFFFF))) {
+ if (LIKELY(V_BITS32_DEFINED == (vbytes & 0xFFFFFFFF))) {
sm->vabits8[sm_off] = VA_BITS8_DEFINED;
return;
} else if (V_BITS32_UNDEFINED == (vbytes & 0xFFFFFFFF)) {
@@ -1588,7 +1581,7 @@
DEBUG("make_mem_defined_if_addressable(%p, %llu)\n", a, (ULong)len);
for (i = 0; i < len; i++) {
vabits2 = get_vabits2( a+i );
- if (EXPECTED_TAKEN(VA_BITS2_NOACCESS != vabits2)) {
+ if (LIKELY(VA_BITS2_NOACCESS != vabits2)) {
set_vabits2(a+i, VA_BITS2_DEFINED);
}
}
@@ -1621,7 +1614,7 @@
while (len >= 4) {
vabits8 = get_vabits8_for_aligned_word32( src+i );
set_vabits8_for_aligned_word32( dst+i, vabits8 );
- if (EXPECTED_TAKEN(VA_BITS8_DEFINED == vabits8
+ if (LIKELY(VA_BITS8_DEFINED == vabits8
|| VA_BITS8_UNDEFINED == vabits8
|| VA_BITS8_NOACCESS == vabits8)) {
/* do nothing */
@@ -1692,7 +1685,7 @@
#ifndef PERF_FAST_STACK2
MC_(make_mem_undefined)(a, 4);
#else
- if (EXPECTED_NOT_TAKEN(a > MAX_PRIMARY_ADDRESS)) {
+ if (UNLIKELY(a > MAX_PRIMARY_ADDRESS)) {
PROF_EVENT(301, "make_aligned_word32_undefined-slow1");
MC_(make_mem_undefined)(a, 4);
return;
@@ -1716,7 +1709,7 @@
#ifndef PERF_FAST_STACK2
MC_(make_mem_noaccess)(a, 4);
#else
- if (EXPECTED_NOT_TAKEN(a > MAX_PRIMARY_ADDRESS)) {
+ if (UNLIKELY(a > MAX_PRIMARY_ADDRESS)) {
PROF_EVENT(311, "make_aligned_word32_noaccess-slow1");
MC_(make_mem_noaccess)(a, 4);
return;
@@ -1741,7 +1734,7 @@
#ifndef PERF_FAST_STACK2
MC_(make_mem_undefined)(a, 8);
#else
- if (EXPECTED_NOT_TAKEN(a > MAX_PRIMARY_ADDRESS)) {
+ if (UNLIKELY(a > MAX_PRIMARY_ADDRESS)) {
PROF_EVENT(321, "make_aligned_word64_undefined-slow1");
MC_(make_mem_undefined)(a, 8);
return;
@@ -1765,7 +1758,7 @@
#ifndef PERF_FAST_STACK2
MC_(make_mem_noaccess)(a, 8);
#else
- if (EXPECTED_NOT_TAKEN(a > MAX_PRIMARY_ADDRESS)) {
+ if (UNLIKELY(a > MAX_PRIMARY_ADDRESS)) {
PROF_EVENT(331, "make_aligned_word64_noaccess-slow1");
MC_(make_mem_noaccess)(a, 8);
return;
@@ -2207,7 +2200,7 @@
# if 0
/* Slow(ish) version, which is fairly easily seen to be correct.
*/
- if (EXPECTED_TAKEN( VG_IS_8_ALIGNED(base) && len==128 )) {
+ if (LIKELY( VG_IS_8_ALIGNED(base) && len==128 )) {
make_aligned_word64_undefined(base + 0);
make_aligned_word64_undefined(base + 8);
make_aligned_word64_undefined(base + 16);
@@ -2240,7 +2233,7 @@
directly into the vabits array. (If the sm was distinguished, this
will make a copy and then write to it.)
*/
- if (EXPECTED_TAKEN( len == 128 && VG_IS_8_ALIGNED(base) )) {
+ if (LIKELY( len == 128 && VG_IS_8_ALIGNED(base) )) {
/* Now we know the address range is suitably sized and aligned. */
UWord a_lo = (UWord)(base);
UWord a_hi = (UWord)(base + 128 - 1);
@@ -2252,7 +2245,7 @@
/* Now we know that the entire address range falls within a
single secondary map, and that that secondary 'lives' in
the main primary map. */
- if (EXPECTED_TAKEN(sm == sm_hi)) {
+ if (LIKELY(sm == sm_hi)) {
// Finally, we know that the range is entirely within one secmap.
UWord v_off = SM_OFF(a_lo);
UShort* p = (UShort*)(&sm->vabits8[v_off]);
@@ -2278,7 +2271,7 @@
}
/* 288 bytes (36 ULongs) is the magic value for ELF ppc64. */
- if (EXPECTED_TAKEN( len == 288 && VG_IS_8_ALIGNED(base) )) {
+ if (LIKELY( len == 288 && VG_IS_8_ALIGNED(base) )) {
/* Now we know the address range is suitably sized and aligned. */
UWord a_lo = (UWord)(base);
UWord a_hi = (UWord)(base + 288 - 1);
@@ -2290,7 +2283,7 @@
/* Now we know that the entire address range falls within a
single secondary map, and that that secondary 'lives' in
the main primary map. */
- if (EXPECTED_TAKEN(sm == sm_hi)) {
+ if (LIKELY(sm == sm_hi)) {
// Finally, we know that the range is entirely within one secmap.
UWord v_off = SM_OFF(a_lo);
UShort* p = (UShort*)(&sm->vabits8[v_off]);
@@ -3755,7 +3748,7 @@
#ifndef PERF_FAST_LOADV
return mc_LOADVn_slow( a, 64, isBigEndian );
#else
- if (EXPECTED_NOT_TAKEN( UNALIGNED_OR_HIGH(a,64) )) {
+ if (UNLIKELY( UNALIGNED_OR_HIGH(a,64) )) {
PROF_EVENT(201, "mc_LOADV64-slow1");
return (ULong)mc_LOADVn_slow( a, 64, isBigEndian );
}
@@ -3767,9 +3760,9 @@
// Handle common case quickly: a is suitably aligned, is mapped, and
// addressible.
// Convert V bits from compact memory form to expanded register form.
- if (EXPECTED_TAKEN(vabits16 == VA_BITS16_DEFINED)) {
+ if (LIKELY(vabits16 == VA_BITS16_DEFINED)) {
return V_BITS64_DEFINED;
- } else if (EXPECTED_TAKEN(vabits16 == VA_BITS16_UNDEFINED)) {
+ } else if (LIKELY(vabits16 == VA_BITS16_UNDEFINED)) {
return V_BITS64_UNDEFINED;
} else {
/* Slow case: the 8 bytes are not all-defined or all-undefined. */
@@ -3802,7 +3795,7 @@
// Investigate further.
mc_STOREVn_slow( a, 64, vbits64, isBigEndian );
#else
- if (EXPECTED_NOT_TAKEN( UNALIGNED_OR_HIGH(a,64) )) {
+ if (UNLIKELY( UNALIGNED_OR_HIGH(a,64) )) {
PROF_EVENT(211, "mc_STOREV64-slow1");
mc_STOREVn_slow( a, 64, vbits64, isBigEndian );
return;
@@ -3812,7 +3805,7 @@
sm_off16 = SM_OFF_16(a);
vabits16 = ((UShort*)(sm->vabits8))[sm_off16];
- if (EXPECTED_TAKEN( !is_distinguished_sm(sm) &&
+ if (LIKELY( !is_distinguished_sm(sm) &&
(VA_BITS16_DEFINED == vabits16 ||
VA_BITS16_UNDEFINED == vabits16) ))
{
@@ -3859,7 +3852,7 @@
#ifndef PERF_FAST_LOADV
return (UWord)mc_LOADVn_slow( a, 32, isBigEndian );
#else
- if (EXPECTED_NOT_TAKEN( UNALIGNED_OR_HIGH(a,32) )) {
+ if (UNLIKELY( UNALIGNED_OR_HIGH(a,32) )) {
PROF_EVENT(221, "mc_LOADV32-slow1");
return (UWord)mc_LOADVn_slow( a, 32, isBigEndian );
}
@@ -3873,9 +3866,9 @@
// Convert V bits from compact memory form to expanded register form.
// For 64-bit platforms, set the high 32 bits of retval to 1 (undefined).
// Almost certainly not necessary, but be paranoid.
- if (EXPECTED_TAKEN(vabits8 == VA_BITS8_DEFINED)) {
+ if (LIKELY(vabits8 == VA_BITS8_DEFINED)) {
return ((UWord)0xFFFFFFFF00000000ULL | (UWord)V_BITS32_DEFINED);
- } else if (EXPECTED_TAKEN(vabits8 == VA_BITS8_UNDEFINED)) {
+ } else if (LIKELY(vabits8 == VA_BITS8_UNDEFINED)) {
return ((UWord)0xFFFFFFFF00000000ULL | (UWord)V_BITS32_UNDEFINED);
} else {
/* Slow case: the 4 bytes are not all-defined or all-undefined. */
@@ -3906,7 +3899,7 @@
#ifndef PERF_FAST_STOREV
mc_STOREVn_slow( a, 32, (ULong)vbits32, isBigEndian );
#else
- if (EXPECTED_NOT_TAKEN( UNALIGNED_OR_HIGH(a,32) )) {
+ if (UNLIKELY( UNALIGNED_OR_HIGH(a,32) )) {
PROF_EVENT(231, "mc_STOREV32-slow1");
mc_STOREVn_slow( a, 32, (ULong)vbits32, isBigEndian );
return;
@@ -3948,7 +3941,7 @@
}
//---------------------------------------------------------------------------
#else
- if (EXPECTED_TAKEN( !is_distinguished_sm(sm) &&
+ if (LIKELY( !is_distinguished_sm(sm) &&
(VA_BITS8_DEFINED == vabits8 ||
VA_BITS8_UNDEFINED == vabits8) ))
{
@@ -3997,7 +3990,7 @@
#ifndef PERF_FAST_LOADV
return (UWord)mc_LOADVn_slow( a, 16, isBigEndian );
#else
- if (EXPECTED_NOT_TAKEN( UNALIGNED_OR_HIGH(a,16) )) {
+ if (UNLIKELY( UNALIGNED_OR_HIGH(a,16) )) {
PROF_EVENT(241, "mc_LOADV16-slow1");
return (UWord)mc_LOADVn_slow( a, 16, isBigEndian );
}
@@ -4046,7 +4039,7 @@
#ifndef PERF_FAST_STOREV
mc_STOREVn_slow( a, 16, (ULong)vbits16, isBigEndian );
#else
- if (EXPECTED_NOT_TAKEN( UNALIGNED_OR_HIGH(a,16) )) {
+ if (UNLIKELY( UNALIGNED_OR_HIGH(a,16) )) {
PROF_EVENT(251, "mc_STOREV16-slow1");
mc_STOREVn_slow( a, 16, (ULong)vbits16, isBigEndian );
return;
@@ -4055,7 +4048,7 @@
sm = get_secmap_for_reading_low(a);
sm_off = SM_OFF(a);
vabits8 = sm->vabits8[sm_off];
- if (EXPECTED_TAKEN( !is_distinguished_sm(sm) &&
+ if (LIKELY( !is_distinguished_sm(sm) &&
(VA_BITS8_DEFINED == vabits8 ||
VA_BITS8_UNDEFINED == vabits8) ))
{
@@ -4105,7 +4098,7 @@
#ifndef PERF_FAST_LOADV
return (UWord)mc_LOADVn_slow( a, 8, False/*irrelevant*/ );
#else
- if (EXPECTED_NOT_TAKEN( UNALIGNED_OR_HIGH(a,8) )) {
+ if (UNLIKELY( UNALIGNED_OR_HIGH(a,8) )) {
PROF_EVENT(261, "mc_LOADV8-slow1");
return (UWord)mc_LOADVn_slow( a, 8, False/*irrelevant*/ );
}
@@ -4145,7 +4138,7 @@
#ifndef PERF_FAST_STOREV
mc_STOREVn_slow( a, 8, (ULong)vbits8, False/*irrelevant*/ );
#else
- if (EXPECTED_NOT_TAKEN( UNALIGNED_OR_HIGH(a,8) )) {
+ if (UNLIKELY( UNALIGNED_OR_HIGH(a,8) )) {
PROF_EVENT(271, "mc_STOREV8-slow1");
mc_STOREVn_slow( a, 8, (ULong)vbits8, False/*irrelevant*/ );
return;
@@ -4154,7 +4147,7 @@
sm = get_secmap_for_reading_low(a);
sm_off = SM_OFF(a);
vabits8 = sm->vabits8[sm_off];
- if (EXPECTED_TAKEN
+ if (LIKELY
( !is_distinguished_sm(sm) &&
( (VA_BITS8_DEFINED == vabits8 || VA_BITS8_UNDEFINED == vabits8)
|| (VA_BITS2_NOACCESS != extract_vabits2_from_vabits8(a, vabits8))
Index: include/pub_tool_basics.h
===================================================================
--- include/pub_tool_basics.h (revision 7742)
+++ include/pub_tool_basics.h (working copy)
@@ -52,7 +52,10 @@
// For varargs types
#include <stdarg.h>
+// For HAVE_BUILTIN_EXPECT
+#include "config.h"
+
/* ---------------------------------------------------------------------
builtin types
------------------------------------------------------------------ */
@@ -155,6 +158,16 @@
// Where to send bug reports to.
#define VG_BUGS_TO "www.valgrind.org"
+/* Branch prediction hints. */
+#if HAVE_BUILTIN_EXPECT
+# define LIKELY(x) __builtin_expect(!!(x), 1)
+# define UNLIKELY(x) __builtin_expect((x), 0)
+#else
+# define LIKELY(x) (x)
+# define UNLIKELY(x) (x)
+#endif
+
+
#endif /* __PUB_TOOL_BASICS_H */
/*--------------------------------------------------------------------*/
Index: coregrind/m_debuginfo/priv_misc.h
===================================================================
--- coregrind/m_debuginfo/priv_misc.h (revision 7742)
+++ coregrind/m_debuginfo/priv_misc.h (working copy)
@@ -37,15 +37,6 @@
#define __PRIV_MISC_H
-#ifdef HAVE_BUILTIN_EXPECT
-#define LIKELY(cond) __builtin_expect(!!(cond),1)
-#define UNLIKELY(cond) __builtin_expect(!!(cond),0)
-#else
-#define LIKELY(cond) (cond)
-#define UNLIKELY(cond) (cond)
-#endif
-
-
/* Allocate(zeroed), free, strdup, all in VG_AR_DINFO. */
void* ML_(dinfo_zalloc)( SizeT szB );
void ML_(dinfo_free)( void* v );
|
|
From: <sv...@va...> - 2008-03-21 17:08:12
|
Author: bart Date: 2008-03-21 17:08:12 +0000 (Fri, 21 Mar 2008) New Revision: 7743 Log: Renamed inbound to downloads. Modified: trunk/exp-drd/docs/README.txt Modified: trunk/exp-drd/docs/README.txt =================================================================== --- trunk/exp-drd/docs/README.txt 2008-03-20 17:55:23 UTC (rev 7742) +++ trunk/exp-drd/docs/README.txt 2008-03-21 17:08:12 UTC (rev 7743) @@ -256,27 +256,31 @@ --------------------------------------------------------------------------- #!/bin/sh +# Make sure that libgmp and libmpfr are installed before you run this script. +# On Debian systems, e.g. Ubuntu, you can install these libraries as follows: +# sudo apt-get install libgmp3-dev libmpfr-dev + GCC_VERSION=4.3.0 FSF_MIRROR=ftp://ftp.easynet.be/gnu SRCDIR=$HOME/software -INBOUND=$SRCDIR/inbound +DOWNLOADS=$SRCDIR/downloads SRC=$HOME/software/gcc-${GCC_VERSION} BUILD=${SRC}-build TAR=gcc-${GCC_VERSION}.tar.bz2 PREFIX=$HOME/gcc-${GCC_VERSION} -rm -rf ${BUILD} || exit $? -rm -rf ${PREFIX} || exit $? -mkdir -p ${BUILD} || exit $? -mkdir -p ${INBOUND} || exit $? -cd ${BUILD} || exit $? +rm -rf ${BUILD} || exit $? +rm -rf ${PREFIX} || exit $? +mkdir -p ${BUILD} || exit $? +mkdir -p ${DOWNLOADS} || exit $? +cd ${BUILD} || exit $? -if [ ! -e $INBOUND/$TAR ]; then - ( cd $INBOUND && wget -q $FSF_MIRROR/gcc/gcc-${GCC_VERSION}/$TAR ) +if [ ! -e $DOWNLOADS/$TAR ]; then + ( cd $DOWNLOADS && wget -q $FSF_MIRROR/gcc/gcc-${GCC_VERSION}/$TAR ) fi if [ ! -e $SRC ]; then - ( cd $SRCDIR && tar -xjf $INBOUND/$TAR ) + ( cd $SRCDIR && tar -xjf $DOWNLOADS/$TAR ) fi ${SRC}/configure \ |
|
From: Nicholas N. <nj...@cs...> - 2008-03-21 09:08:13
|
Bart Van Assche wrote: > Hello, > > Code executed in Valgrind tools that analyzes runtime behavior of > clients often can be made faster by specifying branch prediction > information. E.g. gcc offers the built-in function __builtin_expect() > to allow branch prediction information to be specified in source code. > Unfortunately there is not yet a standard way in Valgrind to specify > branch prediction hints. The patch below is modeled after the include > file linux/compiler.h in the Linux kernel source tree, and should > replace the EXPECTED_TAKEN / EXPECTED_NOT_TAKEN / LIKELY / UNLIKELY > macro's found in various source files. Comments are welcome. > > Index: include/pub_tool_compiler.h > =================================================================== > --- include/pub_tool_compiler.h (revision 0) > +++ include/pub_tool_compiler.h (revision 0) > @@ -0,0 +1,9 @@ > +/* Compiler-dependent functionality. */ > + > +#include "config.h" > + > +#if HAVE_BUILTIN_EXPECT > +#define LIKELY(x) __builtin_expect(!!(x), 1) > +#define UNLIKELY(x) __builtin_expect((x), 0) > +#else > +#define LIKELY(x) (x) > +#define UNLIKELY(x) (x) > +#endif The idea seems ok to me. I'd probably put it in pub_tool_basics.h, though. It would be good if the various other macros were changed to use this one, too. Nick |
|
From: Nicholas N. <nj...@cs...> - 2008-03-21 08:55:53
|
Bart Van Assche wrote: > A question: is self-hosting Valgrind without installing Valgrind > supported ? It resulted in an assertion failure when I tried it. I don't think so -- when I do it, the inner Valgrind is always an installed one. Nick |
|
From: Tom H. <th...@cy...> - 2008-03-21 06:11:49
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2008-03-21 03:15:04 GMT 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 == 330 tests, 76 stderr failures, 1 stdout failure, 29 post failures == memcheck/tests/addressable (stderr) memcheck/tests/badjump (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/erringfds (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-pool-0 (stderr) memcheck/tests/leak-pool-1 (stderr) memcheck/tests/leak-pool-2 (stderr) memcheck/tests/leak-pool-3 (stderr) memcheck/tests/leak-pool-4 (stderr) memcheck/tests/leak-pool-5 (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/long_namespace_xml (stderr) memcheck/tests/lsframe1 (stderr) memcheck/tests/lsframe2 (stderr) memcheck/tests/malloc_free_fill (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/noisy_child (stderr) memcheck/tests/partial_load_dflt (stderr) memcheck/tests/partial_load_ok (stderr) memcheck/tests/partiallydefinedeq (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigkill (stderr) memcheck/tests/stack_changes (stderr) memcheck/tests/varinfo1 (stderr) memcheck/tests/varinfo2 (stderr) memcheck/tests/varinfo3 (stderr) memcheck/tests/varinfo4 (stderr) memcheck/tests/varinfo5 (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/x86/bug152022 (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/x86/xor-undef-x86 (stderr) memcheck/tests/xml1 (stderr) massif/tests/alloc-fns-A (post) massif/tests/alloc-fns-B (post) massif/tests/basic (post) massif/tests/basic2 (post) massif/tests/big-alloc (post) massif/tests/culling1 (stderr) massif/tests/culling2 (stderr) massif/tests/custom_alloc (post) massif/tests/deep-A (post) massif/tests/deep-B (stderr) massif/tests/deep-B (post) massif/tests/deep-C (stderr) massif/tests/deep-C (post) massif/tests/deep-D (post) massif/tests/ignoring (post) massif/tests/insig (post) massif/tests/long-names (post) massif/tests/long-time (post) massif/tests/new-cpp (post) massif/tests/null (post) massif/tests/one (post) massif/tests/overloaded-new (post) massif/tests/peak (post) massif/tests/peak2 (stderr) massif/tests/peak2 (post) massif/tests/realloc (stderr) massif/tests/realloc (post) massif/tests/thresholds_0_0 (post) massif/tests/thresholds_0_10 (post) massif/tests/thresholds_10_0 (post) massif/tests/thresholds_10_10 (post) massif/tests/thresholds_5_0 (post) massif/tests/thresholds_5_10 (post) massif/tests/zero1 (post) massif/tests/zero2 (post) none/tests/blockfault (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/shell (stderr) none/tests/shell_valid1 (stderr) none/tests/shell_valid2 (stderr) none/tests/shell_valid3 (stderr) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/hg06_readshared (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc02_simple_tls (stderr) helgrind/tests/tc03_re_excl (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc07_hbl1 (stderr) helgrind/tests/tc08_hbl2 (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc11_XCHG (stderr) helgrind/tests/tc12_rwl_trivial (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) helgrind/tests/tc24_nonzero_sem (stderr) |
|
From: Tom H. <th...@cy...> - 2008-03-21 04:26:52
|
Nightly build on lloyd ( x86_64, Fedora 7 ) started at 2008-03-21 03:05:08 GMT 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 == 413 tests, 6 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (stderr) |
|
From: Tom H. <th...@cy...> - 2008-03-21 03:52:29
|
Nightly build on aston ( x86_64, Fedora Core 5 ) started at 2008-03-21 03:20:06 GMT 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 == 419 tests, 9 stderr failures, 1 stdout failure, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/x86/scalar (stderr) none/tests/blockfault (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (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 == 419 tests, 9 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/x86/scalar (stderr) none/tests/blockfault (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc08_hbl2 (stdout) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Fri Mar 21 03:36:31 2008 --- new.short Fri Mar 21 03:52:34 2008 *************** *** 8,10 **** ! == 419 tests, 9 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) --- 8,10 ---- ! == 419 tests, 9 stderr failures, 1 stdout failure, 0 post failures == memcheck/tests/malloc_free_fill (stderr) *************** *** 16,18 **** none/tests/mremap2 (stdout) - helgrind/tests/tc08_hbl2 (stdout) helgrind/tests/tc20_verifywrap (stderr) --- 16,17 ---- |
|
From: Tom H. <th...@cy...> - 2008-03-21 03:40:18
|
Nightly build on trojan ( x86_64, Fedora Core 6 ) started at 2008-03-21 03:25:07 GMT 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 == 417 tests, 9 stderr failures, 5 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/bug133694 (stdout) memcheck/tests/x86/bug133694 (stderr) memcheck/tests/x86/scalar (stderr) none/tests/cmdline1 (stdout) none/tests/cmdline2 (stdout) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) |
|
From: Tom H. <th...@cy...> - 2008-03-21 03:33:34
|
Nightly build on dellow ( x86_64, Fedora 8 ) started at 2008-03-21 03:10:05 GMT 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 == 413 tests, 7 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc22_exit_w_lock (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 == 413 tests, 8 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) memcheck/tests/vcpu_fnfns (stdout) memcheck/tests/x86/scalar (stderr) none/tests/faultstatus (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) helgrind/tests/tc18_semabuse (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) ================================================= == Difference between 24 hours ago and now == ================================================= *** old.short Fri Mar 21 03:21:51 2008 --- new.short Fri Mar 21 03:33:33 2008 *************** *** 8,10 **** ! == 413 tests, 8 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) --- 8,10 ---- ! == 413 tests, 7 stderr failures, 2 stdout failures, 0 post failures == memcheck/tests/pointer-trace (stderr) *************** *** 17,19 **** helgrind/tests/tc20_verifywrap (stderr) - helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) --- 17,18 ---- |
|
From: Tom H. <th...@cy...> - 2008-03-21 03:17:08
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2008-03-21 03:00:04 GMT 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 == 419 tests, 32 stderr failures, 3 stdout failures, 0 post failures == memcheck/tests/malloc_free_fill (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/stack_switch (stderr) memcheck/tests/varinfo6 (stderr) memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) none/tests/amd64/insn_ssse3 (stdout) none/tests/amd64/insn_ssse3 (stderr) none/tests/amd64/ssse3_misaligned (stderr) none/tests/blockfault (stderr) none/tests/faultstatus (stderr) none/tests/fdleak_fcntl (stderr) none/tests/mremap (stderr) none/tests/mremap2 (stdout) none/tests/x86/insn_ssse3 (stdout) none/tests/x86/insn_ssse3 (stderr) none/tests/x86/ssse3_misaligned (stderr) helgrind/tests/hg01_all_ok (stderr) helgrind/tests/hg02_deadlock (stderr) helgrind/tests/hg03_inherit (stderr) helgrind/tests/hg04_race (stderr) helgrind/tests/hg05_race2 (stderr) helgrind/tests/tc01_simple_race (stderr) helgrind/tests/tc05_simple_race (stderr) helgrind/tests/tc06_two_races (stderr) helgrind/tests/tc09_bad_unlock (stderr) helgrind/tests/tc14_laog_dinphils (stderr) helgrind/tests/tc16_byterace (stderr) helgrind/tests/tc17_sembar (stderr) helgrind/tests/tc19_shadowmem (stderr) helgrind/tests/tc20_verifywrap (stderr) helgrind/tests/tc21_pthonce (stderr) helgrind/tests/tc22_exit_w_lock (stderr) helgrind/tests/tc23_bogus_condwait (stderr) exp-drd/tests/pth_create_chain (stderr) |