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
(18) |
3
(19) |
4
(17) |
|
5
(6) |
6
(5) |
7
(9) |
8
(21) |
9
(16) |
10
(21) |
11
(22) |
|
12
(19) |
13
(19) |
14
(8) |
15
(16) |
16
(17) |
17
(16) |
18
(33) |
|
19
(33) |
20
(34) |
21
(32) |
22
(26) |
23
(23) |
24
(16) |
25
(21) |
|
26
(19) |
27
(7) |
28
(29) |
29
(27) |
30
(55) |
|
|
|
From: Nicholas N. <nj...@cs...> - 2005-06-26 22:53:15
|
On Mon, 27 Jun 2005, Dirk Mueller wrote: > another one from the "doesn't build" department: > > valgrind.vs is used for linking "stage2", which versions the exported symbols > with VALGRIND_2_1. > > I see several problems with that: > > a) VALGRIND_2_1 wasn't updated to VALGRIND_2_4 > b) stage2 is installed in the valgrind lib subdir, so it doesn't matter > c) stage2 is a plain binary, nothing links against it > > > Newer linkers correctly complain about c) and abort the build, because trying > to version a binary simply doesn't make any sense. At least as far as I can > imagine. > > So, can I just remove that? I thought the point of this file was to force any symbol that doesn't match any of the given prefixes (vgPlain_, etc) to be not exported. And the prefixes are out of date now. I'd be fine with it going. It's caused me troubles in the past by secretly hiding certain symbols that would normally have been public. It doesn't seem to add much. Jeremy, I believe you added it -- does it have some other purpose? N |
|
From: Dirk M. <dm...@gm...> - 2005-06-26 22:15:09
|
Hi, another one from the "doesn't build" department: valgrind.vs is used for linking "stage2", which versions the exported symbols with VALGRIND_2_1. I see several problems with that: a) VALGRIND_2_1 wasn't updated to VALGRIND_2_4 b) stage2 is installed in the valgrind lib subdir, so it doesn't matter c) stage2 is a plain binary, nothing links against it Newer linkers correctly complain about c) and abort the build, because trying to version a binary simply doesn't make any sense. At least as far as I can imagine. So, can I just remove that? Dirk |
|
From: <sv...@va...> - 2005-06-26 20:50:08
|
Author: njn
Date: 2005-06-26 21:50:05 +0100 (Sun, 26 Jun 2005)
New Revision: 4036
Log:
While we're not printing stacktraces from assertion failures, might
as well disable pp_sched_status() -- which produces traces that are less
useful than the main one that has been disabled -- and break the
circular dependence between m_libcassert and m_threadstate.
Modified:
trunk/coregrind/m_libcassert.c
Modified: trunk/coregrind/m_libcassert.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_libcassert.c 2005-06-26 20:44:48 UTC (rev 4035)
+++ trunk/coregrind/m_libcassert.c 2005-06-26 20:50:05 UTC (rev 4036)
@@ -29,7 +29,7 @@
*/
=20
#include "pub_core_basics.h"
-#include "pub_core_threadstate.h"
+//zz hash include "pub_core_threadstate.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
@@ -43,30 +43,32 @@
Assertery.
------------------------------------------------------------------ */
=20
-//zz #if defined(VGP_x86_linux)
-//zz # define GET_REAL_SP_AND_FP(sp, fp) \
-//zz asm("movl %%esp, %0;" \
-//zz "movl %%ebp, %1;" \
-//zz : "=3Dr" (sp),\
-//zz "=3Dr" (fp));
-//zz #elif defined(VGP_amd64_linux)
-//zz # define GET_REAL_SP_AND_FP(sp, fp) \
-//zz asm("movq %%rsp, %0;" \
-//zz "movq %%rbp, %1;" \
-//zz : "=3Dr" (sp),\
-//zz "=3Dr" (fp));
-//zz #elif defined(VGP_ppc32_linux)
-//zz # define GET_REAL_SP_AND_FP(sp, fp) \
-//zz asm("mr %0,1;" \
-//zz "mr %1,1;" \
-//zz : "=3Dr" (sp),\
-//zz "=3Dr" (fp));
-//zz #else
-//zz # error Unknown platform
-//zz #endif
-//zz=20
-//zz #define BACKTRACE_DEPTH 100 // nice and deep!
+#if 0 //zz
+#if defined(VGP_x86_linux)
+# define GET_REAL_SP_AND_FP(sp, fp) \
+ asm("movl %%esp, %0;" \
+ "movl %%ebp, %1;" \
+ : "=3Dr" (sp),\
+ "=3Dr" (fp));
+#elif defined(VGP_amd64_linux)
+# define GET_REAL_SP_AND_FP(sp, fp) \
+ asm("movq %%rsp, %0;" \
+ "movq %%rbp, %1;" \
+ : "=3Dr" (sp),\
+ "=3Dr" (fp));
+#elif defined(VGP_ppc32_linux)
+# define GET_REAL_SP_AND_FP(sp, fp) \
+ asm("mr %0,1;" \
+ "mr %1,1;" \
+ : "=3Dr" (sp),\
+ "=3Dr" (fp));
+#else
+# error Unknown platform
+#endif
=20
+#define BACKTRACE_DEPTH 100 // nice and deep!
+#endif //zz
+
/* Pull down the entire world */
void VG_(exit)( Int status )
{
@@ -79,19 +81,19 @@
}
=20
// Print the scheduler status.
-static void pp_sched_status ( void )
-{
- Int i;=20
- VG_(printf)("\nsched status:\n");=20
- VG_(printf)(" running_tid=3D%d\n", VG_(get_running_tid)());
- for (i =3D 1; i < VG_N_THREADS; i++) {
- if (VG_(threads)[i].status =3D=3D VgTs_Empty) continue;
- VG_(printf)( "\nThread %d: status =3D %s\n", i,=20
- VG_(name_of_ThreadStatus)(VG_(threads)[i].status) );
+//zz static void pp_sched_status ( void )
+//zz {
+//zz Int i;=20
+//zz VG_(printf)("\nsched status:\n");=20
+//zz VG_(printf)(" running_tid=3D%d\n", VG_(get_running_tid)());
+//zz for (i =3D 1; i < VG_N_THREADS; i++) {
+//zz if (VG_(threads)[i].status =3D=3D VgTs_Empty) continue;
+//zz VG_(printf)( "\nThread %d: status =3D %s\n", i,=20
+//zz VG_(name_of_ThreadStatus)(VG_(threads)[i].status=
) );
//zz VG_(get_and_pp_StackTrace)( i, BACKTRACE_DEPTH );
- }
- VG_(printf)("\n");
-}
+//zz }
+//zz VG_(printf)("\n");
+//zz }
=20
__attribute__ ((noreturn))
static void report_and_quit ( const Char* report, Addr ip, Addr sp, Addr=
fp )
@@ -115,12 +117,12 @@
//zz=20
//zz VG_(get_StackTrace2)(ips, BACKTRACE_DEPTH, ip, sp, fp, sp, stack=
top);
//zz VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
-
- // Don't print this, as it's not terribly interesting and avoids a
- // dependence on m_scheduler/, which would be crazy.
- //VG_(printf)("\nBasic block ctr is approximately %llu\n", VG_(bbs_do=
ne) );
-
- pp_sched_status();
+//zz=20
+//zz // Don't print this, as it's not terribly interesting and avoids=
a
+//zz // dependence on m_scheduler/, which would be crazy.
+//zz //VG_(printf)("\nBasic block ctr is approximately %llu\n", VG_(b=
bs_done) );
+//zz=20
+//zz pp_sched_status();
VG_(printf)("\n");
VG_(printf)("Note: see also the FAQ.txt in the source distribution.\n=
");
VG_(printf)("It contains workarounds to several common problems.\n");
@@ -218,7 +220,7 @@
"Valgrind has to exit now. Sorry. Bye!");
VG_(message)(Vg_UserMsg,
"");
- pp_sched_status();
+//zz pp_sched_status();
VG_(exit)(1);
}
=20
|
|
From: <sv...@va...> - 2005-06-26 20:45:32
|
Author: njn
Date: 2005-06-26 21:44:48 +0100 (Sun, 26 Jun 2005)
New Revision: 4035
Log:
Break up VG_(show_BB_profile)(), and move half of it into m_main. This
removes m_transtab's dependence on m_translate (breaking a circular
dependence) and m_debuginfo, hooray.
Modified:
trunk/coregrind/m_main.c
trunk/coregrind/m_redir.c
trunk/coregrind/m_transtab.c
trunk/coregrind/pub_core_transtab.h
Modified: trunk/coregrind/m_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/coregrind/m_main.c 2005-06-26 18:43:40 UTC (rev 4034)
+++ trunk/coregrind/m_main.c 2005-06-26 20:44:48 UTC (rev 4035)
@@ -52,8 +52,9 @@
#include "pub_core_redir.h"
#include "pub_core_scheduler.h"
#include "pub_core_signals.h"
-#include "pub_core_stacks.h" // Needed for VG_(register_stack)
+#include "pub_core_stacks.h" // For VG_(register_stack)
#include "pub_core_syswrap.h"
+#include "pub_core_translate.h" // For VG_(get_BB_profile)
#include "pub_core_tooliface.h"
#include "pub_core_trampoline.h"
#include "pub_core_transtab.h"
@@ -2260,6 +2261,81 @@
=20
=20
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
+/*=3D=3D=3D BB profiling =
=3D=3D=3D*/
+/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
+
+static=20
+void show_BB_profile ( BBProfEntry tops[], UInt n_tops, ULong score_tota=
l )
+{
+ ULong score_cumul, score_here;
+ Char buf_cumul[10], buf_here[10];
+ Char name[64];
+ Int r;
+
+ VG_(printf)("\n");
+ VG_(printf)("--------------------------------------------------------=
---\n");
+ VG_(printf)("--- BEGIN BB Profile (summary of scores) =
---\n");
+ VG_(printf)("--------------------------------------------------------=
---\n");
+ VG_(printf)("\n");
+
+ VG_(printf)("Total score =3D %lld\n\n", score_total);
+
+ score_cumul =3D 0;
+ for (r =3D 0; r < n_tops; r++) {
+ if (tops[r].addr =3D=3D 0)
+ continue;
+ name[0] =3D 0;
+ VG_(get_fnname_w_offset)(tops[r].addr, name, 64);
+ name[63] =3D 0;
+ score_here =3D tops[r].score;
+ score_cumul +=3D score_here;
+ VG_(percentify)(score_cumul, score_total, 2, 6, buf_cumul);
+ VG_(percentify)(score_here, score_total, 2, 6, buf_here);
+ VG_(printf)("%3d: (%9lld %s) %9lld %s 0x%llx %s\n",
+ r,
+ score_cumul, buf_cumul,
+ score_here, buf_here, tops[r].addr, name );
+ }
+
+ VG_(printf)("\n");
+ VG_(printf)("--------------------------------------------------------=
---\n");
+ VG_(printf)("--- BB Profile (BB details) =
---\n");
+ VG_(printf)("--------------------------------------------------------=
---\n");
+ VG_(printf)("\n");
+
+ score_cumul =3D 0;
+ for (r =3D 0; r < n_tops; r++) {
+ if (tops[r].addr =3D=3D 0)
+ continue;
+ name[0] =3D 0;
+ VG_(get_fnname_w_offset)(tops[r].addr, name, 64);
+ name[63] =3D 0;
+ score_here =3D tops[r].score;
+ score_cumul +=3D score_here;
+ VG_(percentify)(score_cumul, score_total, 2, 6, buf_cumul);
+ VG_(percentify)(score_here, score_total, 2, 6, buf_here);
+ VG_(printf)("\n");
+ VG_(printf)("=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
begin BB rank %d "
+ "=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
\n\n", r);
+ VG_(printf)("%3d: (%9lld %s) %9lld %s 0x%llx %s\n",
+ r,
+ score_cumul, buf_cumul,
+ score_here, buf_here, tops[r].addr, name );
+ VG_(printf)("\n");
+ VG_(translate)(0, tops[r].addr, True, VG_(clo_profile_flags), 0);
+ VG_(printf)("=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
end BB rank %d "
+ "=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
\n\n", r);
+ }
+
+ VG_(printf)("\n");
+ VG_(printf)("--------------------------------------------------------=
---\n");
+ VG_(printf)("--- END BB Profile =
---\n");
+ VG_(printf)("--------------------------------------------------------=
---\n");
+ VG_(printf)("\n");
+}
+
+
+/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D main() =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
=20
@@ -2849,9 +2925,14 @@
=20
if (VG_(clo_profile))
VG_(done_profiling)();
- if (VG_(clo_profile_flags) > 0)
- VG_(show_BB_profile)();
=20
+ if (VG_(clo_profile_flags) > 0) {
+ #define N_MAX 100
+ BBProfEntry tops[N_MAX];
+ ULong score_total =3D VG_(get_BB_profile) (tops, N_MAX);
+ show_BB_profile(tops, N_MAX, score_total);
+ }
+
/* Print Vex storage stats */
if (0)
LibVEX_ShowAllocStats();
Modified: trunk/coregrind/m_redir.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_redir.c 2005-06-26 18:43:40 UTC (rev 4034)
+++ trunk/coregrind/m_redir.c 2005-06-26 20:44:48 UTC (rev 4035)
@@ -203,7 +203,9 @@
return ok; =20
}
=20
-// Resolve a redir using any SegInfo if possible.
+// Resolve a redir using any SegInfo if possible. This is called whenev=
er
+// a new sym-to-addr redir is created. It covers the case where a
+// replacement function is loaded after its replacee.
static Bool resolve_redir_with_existing_seginfos(CodeRedirect *redir)
{
const SegInfo *si;
@@ -219,7 +221,8 @@
}
=20
// Resolve as many unresolved redirs as possible with this SegInfo. Thi=
s
-// should be called when a new SegInfo symtab is loaded.
+// should be called when a new SegInfo symtab is loaded. It covers the =
case
+// where a replacee function is loaded after its replacement function.
void VG_(resolve_existing_redirs_with_seginfo)(SegInfo *si)
{
CodeRedirect **prevp =3D &unresolved_redirs;
@@ -287,7 +290,9 @@
TRACE_REDIR("REDIR sym to addr: %s:%s to %p", from_lib, from_sym, to_=
addr);
=20
// Check against all existing segments to see if this redirection
- // can be resolved immediately. Then add it to the appropriate list.
+ // can be resolved immediately (as will be the case when the replacem=
ent
+ // function is loaded after the replacee). Then add it to the
+ // appropriate list.
if (resolve_redir_with_existing_seginfos(redir)) {
add_redir_to_resolved_list(redir);
} else {
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-06-26 18:43:40 UTC (rev 4034)
+++ trunk/coregrind/m_transtab.c 2005-06-26 20:44:48 UTC (rev 4035)
@@ -30,15 +30,12 @@
*/
=20
#include "pub_core_basics.h"
-#include "pub_core_debuginfo.h" // For VG_(get_fnname_w_offset)()
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcmman.h" // For VG_(get_memory_from_mmap)()
#include "pub_core_libcprint.h"
#include "pub_core_options.h"
#include "pub_core_tooliface.h" // For VG_(details).avg_translation_=
sizeB
-// XXX: this module should not depend on m_translate!
-#include "pub_core_translate.h" // For VG_(translate)()
#include "pub_core_transtab.h"
=20
/* #define DEBUG_TRANSTAB */
@@ -670,34 +667,23 @@
/*--- Printing out of profiling results. ---*/
/*------------------------------------------------------------*/
=20
-/* Only the top N_MAX bbs will be displayed. */
-#define N_MAX 200
-
-static TTEntry* tops[N_MAX];
-
static ULong score ( TTEntry* tte )
{
return ((ULong)tte->weight) * ((ULong)tte->count);
}
=20
-static Bool heavier ( TTEntry* t1, TTEntry* t2 )
+ULong VG_(get_BB_profile) ( BBProfEntry tops[], UInt n_tops )
{
- return score(t1) > score(t2);
-}
-
-void VG_(show_BB_profile) ( void )
-{
- Char name[64];
Int sno, i, r, s;
- ULong score_total, score_cumul, score_here;
- Char buf_cumul[10];
- Char buf_here[10];
+ ULong score_total;
=20
/* First, compute the total weighted count, and find the top N
- ttes. tops contains pointers to the most-used N_MAX blocks, in
+ ttes. tops contains pointers to the most-used n_tops blocks, in
descending order (viz, tops[0] is the highest scorer). */
- for (i =3D 0; i < N_MAX; i++)
- tops[i] =3D NULL;
+ for (i =3D 0; i < n_tops; i++) {
+ tops[i].addr =3D 0;
+ tops[i].score =3D 0;
+ }
=20
score_total =3D 0;
=20
@@ -709,95 +695,36 @@
continue;
score_total +=3D score(§ors[sno].tt[i]);
/* Find the rank for sectors[sno].tt[i]. */
- r =3D N_MAX-1;
+ r =3D n_tops-1;
while (True) {
if (r =3D=3D -1)
break;
- if (tops[r] =3D=3D NULL) {
+ if (tops[r].addr =3D=3D 0) {
r--;=20
continue;
}
- if (heavier(§ors[sno].tt[i], tops[r])) {
+ if ( score(§ors[sno].tt[i]) > tops[r].score ) {
r--;
continue;
}
break;
}
r++;
- vg_assert(r >=3D 0 && r <=3D N_MAX);
+ vg_assert(r >=3D 0 && r <=3D n_tops);
/* This bb should be placed at r, and bbs above it shifted
upwards one slot. */
- if (r < N_MAX) {
- for (s =3D N_MAX-1; s > r; s--)
+ if (r < n_tops) {
+ for (s =3D n_tops-1; s > r; s--)
tops[s] =3D tops[s-1];
- tops[r] =3D §ors[sno].tt[i];
+ tops[r].addr =3D sectors[sno].tt[i].entry;
+ tops[r].score =3D score( §ors[sno].tt[i] );
}
}
}
=20
- VG_(printf)("\n");
- VG_(printf)("--------------------------------------------------------=
----\n");
- VG_(printf)("--- BEGIN BB Profile (summary of scores) =
---\n");
- VG_(printf)("--------------------------------------------------------=
----\n");
- VG_(printf)("\n");
-
- VG_(printf)("Total score =3D %lld\n\n", score_total);
-
- score_cumul =3D 0;
- for (r =3D 0; r < N_MAX; r++) {
- if (tops[r] =3D=3D NULL)
- continue;
- name[0] =3D 0;
- VG_(get_fnname_w_offset)(tops[r]->entry, name, 64);
- name[63] =3D 0;
- score_here =3D score(tops[r]);
- score_cumul +=3D score_here;
- VG_(percentify)(score_cumul, score_total, 2, 6, buf_cumul);
- VG_(percentify)(score_here, score_total, 2, 6, buf_here);
- VG_(printf)("%3d: (%9lld %s) %9lld %s 0x%llx %s\n",
- r,
- score_cumul, buf_cumul,
- score_here, buf_here, tops[r]->entry, name );
- }
-
- VG_(printf)("\n");
- VG_(printf)("--------------------------------------------------------=
----\n");
- VG_(printf)("--- BB Profile (BB details) =
---\n");
- VG_(printf)("--------------------------------------------------------=
----\n");
- VG_(printf)("\n");
-
- score_cumul =3D 0;
- for (r =3D 0; r < N_MAX; r++) {
- if (tops[r] =3D=3D NULL)
- continue;
- name[0] =3D 0;
- VG_(get_fnname_w_offset)(tops[r]->entry, name, 64);
- name[63] =3D 0;
- score_here =3D score(tops[r]);
- score_cumul +=3D score_here;
- VG_(percentify)(score_cumul, score_total, 2, 6, buf_cumul);
- VG_(percentify)(score_here, score_total, 2, 6, buf_here);
- VG_(printf)("\n");
- VG_(printf)("=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
begin BB rank %d "
- "=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
\n\n", r);
- VG_(printf)("%3d: (%9lld %s) %9lld %s 0x%llx %s\n",
- r,
- score_cumul, buf_cumul,
- score_here, buf_here, tops[r]->entry, name );
- VG_(printf)("\n");
- VG_(translate)(0, tops[r]->entry, True, VG_(clo_profile_flags), 0)=
;
- VG_(printf)("=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
end BB rank %d "
- "=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
\n\n", r);
- }
-
- VG_(printf)("\n");
- VG_(printf)("--------------------------------------------------------=
----\n");
- VG_(printf)("--- END BB Profile =
---\n");
- VG_(printf)("--------------------------------------------------------=
----\n");
- VG_(printf)("\n");
+ return score_total;
}
=20
-
/*--------------------------------------------------------------------*/
/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_transtab.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_transtab.h 2005-06-26 18:43:40 UTC (rev 4034=
)
+++ trunk/coregrind/pub_core_transtab.h 2005-06-26 20:44:48 UTC (rev 4035=
)
@@ -61,9 +61,15 @@
=20
extern UInt VG_(get_bbs_translated) ( void );
=20
-extern void VG_(show_BB_profile) ( void );
+// BB profiling stuff
=20
+typedef struct _BBProfEntry {
+ Addr64 addr;
+ ULong score;
+} BBProfEntry;
=20
+extern ULong VG_(get_BB_profile) ( BBProfEntry tops[], UInt n_tops );
+
#endif // __PUB_CORE_TRANSTAB_H
=20
/*--------------------------------------------------------------------*/
|
|
From: <sv...@va...> - 2005-06-26 18:43:44
|
Author: njn
Date: 2005-06-26 19:43:40 +0100 (Sun, 26 Jun 2005)
New Revision: 4034
Log:
Combine the percentify() functions from Cachegrind and m_transtab into
a single more general one exported from m_libcprint.
Modified:
trunk/cachegrind/cg_main.c
trunk/coregrind/m_libcprint.c
trunk/coregrind/m_transtab.c
trunk/include/pub_tool_libcprint.h
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-06-26 17:26:22 UTC (rev 4033)
+++ trunk/cachegrind/cg_main.c 2005-06-26 18:43:40 UTC (rev 4034)
@@ -907,22 +907,6 @@
return w + (w-1)/3; // add space for commas
}
=20
-static
-void percentify(Int n, Int ex, Int field_width, char buf[])=20
-{
- int i, len, space;
- =20
- VG_(sprintf)(buf, "%d.%d%%", n / ex, n % ex);
- len =3D VG_(strlen)(buf);
- space =3D field_width - len;
- if (space < 0) space =3D 0; /* Allow for v. small field_width */
- i =3D len;
-
- /* Right justify in field */
- for ( ; i >=3D 0; i--) buf[i + space] =3D buf[i];
- for (i =3D 0; i < space; i++) buf[i] =3D ' ';
-}
-
static void cg_fini(Int exitcode)
{
static char buf1[128], buf2[128], buf3[128], fmt [128];
@@ -954,10 +938,10 @@
p =3D 100;
=20
if (0 =3D=3D Ir_total.a) Ir_total.a =3D 1;
- percentify(Ir_total.m1 * 100 * p / Ir_total.a, p, l1+1, buf1);
+ VG_(percentify)(Ir_total.m1, Ir_total.a, 2, l1+1, buf1);
VG_(message)(Vg_UserMsg, "I1 miss rate: %s", buf1);
=20
- percentify(Ir_total.m2 * 100 * p / Ir_total.a, p, l1+1, buf1);
+ VG_(percentify)(Ir_total.m2, Ir_total.a, 2, l1+1, buf1);
VG_(message)(Vg_UserMsg, "L2i miss rate: %s", buf1);
VG_(message)(Vg_UserMsg, "");
=20
@@ -982,14 +966,14 @@
if (0 =3D=3D D_total.a) D_total.a =3D 1;
if (0 =3D=3D Dr_total.a) Dr_total.a =3D 1;
if (0 =3D=3D Dw_total.a) Dw_total.a =3D 1;
- percentify( D_total.m1 * 100 * p / D_total.a, p, l1+1, buf1);
- percentify(Dr_total.m1 * 100 * p / Dr_total.a, p, l2+1, buf2);
- percentify(Dw_total.m1 * 100 * p / Dw_total.a, p, l3+1, buf3);
+ VG_(percentify)( D_total.m1, D_total.a, 1, l1+1, buf1);
+ VG_(percentify)(Dr_total.m1, Dr_total.a, 1, l2+1, buf2);
+ VG_(percentify)(Dw_total.m1, Dw_total.a, 1, l3+1, buf3);
VG_(message)(Vg_UserMsg, "D1 miss rate: %s (%s + %s )", buf1, buf=
2,buf3);
=20
- percentify( D_total.m2 * 100 * p / D_total.a, p, l1+1, buf1);
- percentify(Dr_total.m2 * 100 * p / Dr_total.a, p, l2+1, buf2);
- percentify(Dw_total.m2 * 100 * p / Dw_total.a, p, l3+1, buf3);
+ VG_(percentify)( D_total.m2, D_total.a, 1, l1+1, buf1);
+ VG_(percentify)(Dr_total.m2, Dr_total.a, 1, l2+1, buf2);
+ VG_(percentify)(Dw_total.m2, Dw_total.a, 1, l3+1, buf3);
VG_(message)(Vg_UserMsg, "L2d miss rate: %s (%s + %s )", buf1, buf=
2,buf3);
VG_(message)(Vg_UserMsg, "");
=20
@@ -1007,9 +991,9 @@
VG_(message)(Vg_UserMsg, fmt, "L2 misses: ",
L2_total_m, L2_total_mr, L2_total_mw);
=20
- percentify(L2_total_m * 100 * p / (Ir_total.a + D_total.a), p, l1+1=
, buf1);
- percentify(L2_total_mr * 100 * p / (Ir_total.a + Dr_total.a), p, l2+1=
, buf2);
- percentify(L2_total_mw * 100 * p / Dw_total.a, p, l3+1, buf3);
+ VG_(percentify)(L2_total_m, (Ir_total.a + D_total.a), 1, l1+1, buf1=
);
+ VG_(percentify)(L2_total_mr, (Ir_total.a + Dr_total.a), 1, l2+1, buf2=
);
+ VG_(percentify)(L2_total_mw, Dw_total.a, 1, l3+1, buf3=
);
VG_(message)(Vg_UserMsg, "L2 miss rate: %s (%s + %s )", buf1, buf=
2,buf3);
=20
=20
Modified: trunk/coregrind/m_libcprint.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_libcprint.c 2005-06-26 17:26:22 UTC (rev 4033)
+++ trunk/coregrind/m_libcprint.c 2005-06-26 18:43:40 UTC (rev 4034)
@@ -151,6 +151,47 @@
}
=20
/* ---------------------------------------------------------------------
+ percentify()
+ ------------------------------------------------------------------ */
+
+// Percentify n/m with p decimal places. Includes the '%' symbol at the=
end.
+void VG_(percentify)(UInt n, UInt m, UInt d, Int n_buf, char buf[])=20
+{
+ Int i, len, space;
+
+ ULong p1 =3D (100*n) / m;
+ =20
+ if (d =3D=3D 0) {
+ VG_(sprintf)(buf, "%lld%%", p1);
+ } else {
+ ULong p2;
+ UInt ex;
+ Char fmt[32];
+ switch (d) {
+ case 1: ex =3D 10; break;
+ case 2: ex =3D 100; break;
+ case 3: ex =3D 1000; break;
+ default: VG_(tool_panic)("Currently can only handle 3 decimal plac=
es");
+ }
+ p2 =3D ((100*n*ex) / m) % ex;
+ // Have to generate the format string in order to be flexible abou=
t
+ // the width of the post-decimal-point part.
+ VG_(sprintf)(fmt, "%%lld.%%0%dlld%%%%", d);
+ // fmt is now "%lld.%0<d>lld%%" where <d> is 1,2,3...
+ VG_(sprintf)(buf, fmt, p1, p2);
+ }
+
+ len =3D VG_(strlen)(buf);
+ space =3D n_buf - len;
+ if (space < 0) space =3D 0; /* Allow for v. small field_width */
+ i =3D len;
+
+ /* Right justify in field */
+ for ( ; i >=3D 0; i--) buf[i + space] =3D buf[i];
+ for (i =3D 0; i < space; i++) buf[i] =3D ' ';
+}
+
+/* ---------------------------------------------------------------------
message()
------------------------------------------------------------------ */
=20
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-06-26 17:26:22 UTC (rev 4033)
+++ trunk/coregrind/m_transtab.c 2005-06-26 18:43:40 UTC (rev 4034)
@@ -685,32 +685,6 @@
return score(t1) > score(t2);
}
=20
-/* Print n/m in form xx.yy% */
-static
-void percentify ( ULong n, ULong m, Int field_width, Char* buf)
-{
- Int i, len, space;
- ULong lo, hi;
- if (m =3D=3D 0) m =3D 1; /* stay sane */
- hi =3D (n * 100) / m;
- lo =3D (((n * 100) - hi * m) * 100) / m;
- vg_assert(lo < 100);
- if (lo < 10)
- VG_(sprintf)(buf, "%lld.0%lld%%", hi, lo);
- else
- VG_(sprintf)(buf, "%lld.%lld%%", hi, lo);
-
- len =3D VG_(strlen)(buf);
- space =3D field_width - len;
- if (space < 0) space =3D 0; /* Allow for v. small field_width */
- i =3D len;
-
- /* Right justify in field */
- for ( ; i >=3D 0; i--) buf[i + space] =3D buf[i];
- for (i =3D 0; i < space; i++) buf[i] =3D ' ';
-}
-
-
void VG_(show_BB_profile) ( void )
{
Char name[64];
@@ -778,8 +752,8 @@
name[63] =3D 0;
score_here =3D score(tops[r]);
score_cumul +=3D score_here;
- percentify(score_cumul, score_total, 6, buf_cumul);
- percentify(score_here, score_total, 6, buf_here);
+ VG_(percentify)(score_cumul, score_total, 2, 6, buf_cumul);
+ VG_(percentify)(score_here, score_total, 2, 6, buf_here);
VG_(printf)("%3d: (%9lld %s) %9lld %s 0x%llx %s\n",
r,
score_cumul, buf_cumul,
@@ -801,8 +775,8 @@
name[63] =3D 0;
score_here =3D score(tops[r]);
score_cumul +=3D score_here;
- percentify(score_cumul, score_total, 6, buf_cumul);
- percentify(score_here, score_total, 6, buf_here);
+ VG_(percentify)(score_cumul, score_total, 2, 6, buf_cumul);
+ VG_(percentify)(score_here, score_total, 2, 6, buf_here);
VG_(printf)("\n");
VG_(printf)("=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
begin BB rank %d "
"=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D=
\n\n", r);
Modified: trunk/include/pub_tool_libcprint.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_libcprint.h 2005-06-26 17:26:22 UTC (rev 4033)
+++ trunk/include/pub_tool_libcprint.h 2005-06-26 18:43:40 UTC (rev 4034)
@@ -45,6 +45,9 @@
extern UInt VG_(sprintf) ( Char* buf, const HChar* format, ... );
extern UInt VG_(vsprintf)( Char* buf, const HChar* format, va_list vargs=
);
=20
+// Percentify n/m with p decimal places. Includes the '%' symbol at the=
end.
+extern void VG_(percentify)(UInt n, UInt m, UInt d, Int n_buf, char buf[=
]);
+
/* ---------------------------------------------------------------------
Messages for the user
------------------------------------------------------------------ */
|
|
From: <sv...@va...> - 2005-06-26 17:26:34
|
Author: njn
Date: 2005-06-26 18:26:22 +0100 (Sun, 26 Jun 2005)
New Revision: 4033
Log:
Remove empty sanity check function. And clean up sanity checking in=20
m_scheduler a little.
Modified:
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_transtab.c
trunk/coregrind/pub_core_transtab.h
Modified: trunk/coregrind/m_scheduler/scheduler.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_scheduler/scheduler.c 2005-06-26 15:11:37 UTC (rev =
4032)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-26 17:26:22 UTC (rev =
4033)
@@ -1092,24 +1092,14 @@
VGP_PUSHCC(VgpCoreExpensiveSanity);
sanity_slow_count++;
=20
-# if 0
- { void zzzmemscan(void); zzzmemscan(); }
-# endif
-
- if ((sanity_fast_count % 250) =3D=3D 0)
- VG_(sanity_check_tt_tc)("VG_(sanity_check_general)");
-
if (VG_(needs).sanity_checks) {
VGP_PUSHCC(VgpToolExpensiveSanity);
vg_assert(VG_TDICT_CALL(tool_expensive_sanity_check));
VGP_POPCC(VgpToolExpensiveSanity);
}
=20
- /* Check that Segments and /proc/self/maps match up */
- //vg_assert(VG_(sanity_check_memory)());
-
/* Look for stack overruns. Visit all threads. */
- for(tid =3D 1; tid < VG_N_THREADS; tid++) {
+ for (tid =3D 1; tid < VG_N_THREADS; tid++) {
SSizeT remains;
=20
if (VG_(threads)[tid].status =3D=3D VgTs_Empty ||
@@ -1124,9 +1114,6 @@
tid, remains);
}
=20
- /*=20
- if ((sanity_fast_count % 500) =3D=3D 0) VG_(mallocSanityCheckAll)(=
);=20
- */
VGP_POPCC(VgpCoreExpensiveSanity);
}
=20
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-06-26 15:11:37 UTC (rev 4032)
+++ trunk/coregrind/m_transtab.c 2005-06-26 17:26:22 UTC (rev 4033)
@@ -578,15 +578,6 @@
=20
=20
/*------------------------------------------------------------*/
-/*--- Sanity checking ---*/
-/*------------------------------------------------------------*/
-
-void VG_(sanity_check_tt_tc) ( Char* who )
-{
-}
-
-
-/*------------------------------------------------------------*/
/*--- Initialisation. ---*/
/*------------------------------------------------------------*/
=20
Modified: trunk/coregrind/pub_core_transtab.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_transtab.h 2005-06-26 15:11:37 UTC (rev 4032=
)
+++ trunk/coregrind/pub_core_transtab.h 2005-06-26 17:26:22 UTC (rev 4033=
)
@@ -57,8 +57,6 @@
=20
extern void VG_(discard_translations) ( Addr64 start, UInt range );
=20
-extern void VG_(sanity_check_tt_tc) ( Char* caller );
-
extern void VG_(print_tt_tc_stats) ( void );
=20
extern UInt VG_(get_bbs_translated) ( void );
|
|
From: <sv...@va...> - 2005-06-26 15:11:42
|
Author: njn
Date: 2005-06-26 16:11:37 +0100 (Sun, 26 Jun 2005)
New Revision: 4032
Log:
Simplify atfork to only provide the functionality we need.
Modified:
trunk/coregrind/m_libcproc.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_syswrap/syswrap-amd64-linux.c
trunk/coregrind/m_syswrap/syswrap-generic.c
trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c
trunk/coregrind/m_syswrap/syswrap-x86-linux.c
trunk/coregrind/pub_core_libcproc.h
Modified: trunk/coregrind/m_libcproc.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_libcproc.c 2005-06-26 14:48:23 UTC (rev 4031)
+++ trunk/coregrind/m_libcproc.c 2005-06-26 15:11:37 UTC (rev 4032)
@@ -422,67 +422,26 @@
}
=20
/* ---------------------------------------------------------------------
- A simple atfork() facility for Valgrind's internal use
+ A trivial atfork() facility for Valgrind's internal use
------------------------------------------------------------------ */
=20
-struct atfork {
- vg_atfork_t pre;
- vg_atfork_t parent;
- vg_atfork_t child;
-};
+// Trivial because it only supports a single post-fork child action, whi=
ch
+// is all we need.
=20
-#define VG_MAX_ATFORK 10
+static vg_atfork_t atfork_child =3D NULL;
=20
-static struct atfork atforks[VG_MAX_ATFORK];
-static Int n_atfork;
-
-void VG_(atfork)(vg_atfork_t pre, vg_atfork_t parent, vg_atfork_t child)
+void VG_(atfork_child)(vg_atfork_t child)
{
- Int i;
+ if (NULL !=3D atfork_child)
+ VG_(core_panic)("More than one atfork_child handler requested");
=20
- for(i =3D 0; i < n_atfork; i++) {
- if (atforks[i].pre =3D=3D pre &&
- atforks[i].parent =3D=3D parent &&
- atforks[i].child =3D=3D child)
- return;
- }
-
- if (n_atfork >=3D VG_MAX_ATFORK)
- VG_(core_panic)("Too many VG_(atfork) handlers requested: "
- "raise VG_MAX_ATFORK");
-
- atforks[n_atfork].pre =3D pre;
- atforks[n_atfork].parent =3D parent;
- atforks[n_atfork].child =3D child;
-
- n_atfork++;
+ atfork_child =3D child;
}
=20
-void VG_(do_atfork_pre)(ThreadId tid)
-{
- Int i;
-
- for(i =3D 0; i < n_atfork; i++)
- if (atforks[i].pre !=3D NULL)
- (*atforks[i].pre)(tid);
-}
-
-void VG_(do_atfork_parent)(ThreadId tid)
-{
- Int i;
-
- for(i =3D 0; i < n_atfork; i++)
- if (atforks[i].parent !=3D NULL)
- (*atforks[i].parent)(tid);
-}
-
void VG_(do_atfork_child)(ThreadId tid)
{
- Int i;
-
- for(i =3D 0; i < n_atfork; i++)
- if (atforks[i].child !=3D NULL)
- (*atforks[i].child)(tid);
+ if (NULL !=3D atfork_child)
+ (*atfork_child)(tid);
}
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_scheduler/scheduler.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_scheduler/scheduler.c 2005-06-26 14:48:23 UTC (rev =
4031)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-26 15:11:37 UTC (rev =
4032)
@@ -541,7 +541,7 @@
=3D VG_(clstk_end) - sizeof(=
UWord);
VG_(threads)[tid_main].client_stack_szB =3D VG_(client_rlimit_stack)=
.rlim_cur;
=20
- VG_(atfork)(NULL, NULL, sched_fork_cleanup);
+ VG_(atfork_child)(sched_fork_cleanup);
}
=20
=20
Modified: trunk/coregrind/m_syswrap/syswrap-amd64-linux.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_syswrap/syswrap-amd64-linux.c 2005-06-26 14:48:23 U=
TC (rev 4031)
+++ trunk/coregrind/m_syswrap/syswrap-amd64-linux.c 2005-06-26 15:11:37 U=
TC (rev 4032)
@@ -495,8 +495,6 @@
VG_(sigfillset)(&mask);
VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, &fork_saved_mask);
=20
- VG_(do_atfork_pre)(tid);
-
/* Since this is the fork() form of clone, we don't need all that
VG_(clone) stuff */
res =3D VG_(do_syscall5)( __NR_clone, flags,=20
@@ -517,8 +515,6 @@
VG_(printf)(" clone(fork): process %d created child %d\n",=20
VG_(getpid)(), res.val);
=20
- VG_(do_atfork_parent)(tid);
-
/* restore signal mask */
VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL);
}
Modified: trunk/coregrind/m_syswrap/syswrap-generic.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_syswrap/syswrap-generic.c 2005-06-26 14:48:23 UTC (=
rev 4031)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2005-06-26 15:11:37 UTC (=
rev 4032)
@@ -2730,8 +2730,6 @@
VG_(sigfillset)(&mask);
VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, &fork_saved_mask);
=20
- VG_(do_atfork_pre)(tid);
-
SET_STATUS_from_SysRes( VG_(do_syscall0)(__NR_fork) );
=20
if (SUCCESS && RES =3D=3D 0) {
@@ -2744,8 +2742,6 @@
if (SUCCESS && RES > 0) {
PRINT(" fork: process %d created child %d\n", VG_(getpid)(), RES=
);
=20
- VG_(do_atfork_parent)(tid);
-
/* restore signal mask */
VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL);
}
Modified: trunk/coregrind/m_syswrap/syswrap-ppc32-linux.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_syswrap/syswrap-ppc32-linux.c 2005-06-26 14:48:23 U=
TC (rev 4031)
+++ trunk/coregrind/m_syswrap/syswrap-ppc32-linux.c 2005-06-26 15:11:37 U=
TC (rev 4032)
@@ -545,8 +545,6 @@
//.. VG_(sigfillset)(&mask);
//.. VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, &fork_saved_mask);
//..=20
-//.. VG_(do_atfork_pre)(tid);
-//..=20
//.. /* Since this is the fork() form of clone, we don't need all tha=
t
//.. VG_(clone) stuff */
//.. ret =3D VG_(do_syscall5)(__NR_clone, flags, (UWord)NULL, (UWord)=
parent_tidptr,=20
@@ -563,8 +561,6 @@
//.. if (VG_(clo_trace_syscalls))
//.. VG_(printf)(" clone(fork): process %d created child %d\n", VG_=
(getpid)(), ret);
//..=20
-//.. VG_(do_atfork_parent)(tid);
-//..=20
//.. /* restore signal mask */
//.. VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL);
//.. }
Modified: trunk/coregrind/m_syswrap/syswrap-x86-linux.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_syswrap/syswrap-x86-linux.c 2005-06-26 14:48:23 UTC=
(rev 4031)
+++ trunk/coregrind/m_syswrap/syswrap-x86-linux.c 2005-06-26 15:11:37 UTC=
(rev 4032)
@@ -512,8 +512,6 @@
VG_(sigfillset)(&mask);
VG_(sigprocmask)(VKI_SIG_SETMASK, &mask, &fork_saved_mask);
=20
- VG_(do_atfork_pre)(tid);
-
/* Since this is the fork() form of clone, we don't need all that
VG_(clone) stuff */
res =3D VG_(do_syscall5)( __NR_clone, flags,=20
@@ -534,8 +532,6 @@
VG_(printf)(" clone(fork): process %d created child %d\n",=20
VG_(getpid)(), res.val);
=20
- VG_(do_atfork_parent)(tid);
-
/* restore signal mask */
VG_(sigprocmask)(VKI_SIG_SETMASK, &fork_saved_mask, NULL);
}
Modified: trunk/coregrind/pub_core_libcproc.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_libcproc.h 2005-06-26 14:48:23 UTC (rev 4031=
)
+++ trunk/coregrind/pub_core_libcproc.h 2005-06-26 15:11:37 UTC (rev 4032=
)
@@ -77,10 +77,8 @@
=20
// atfork
typedef void (*vg_atfork_t)(ThreadId);
-extern void VG_(atfork)(vg_atfork_t pre, vg_atfork_t parent, vg_atfork_t=
child);
-extern void VG_(do_atfork_pre) ( ThreadId tid );
-extern void VG_(do_atfork_parent) ( ThreadId tid );
-extern void VG_(do_atfork_child) ( ThreadId tid );
+extern void VG_(atfork_child) ( vg_atfork_t child_action );
+extern void VG_(do_atfork_child) ( ThreadId tid );
=20
#endif // __PUB_CORE_LIBCPROC_H
=20
|
|
From: <sv...@va...> - 2005-06-26 14:48:28
|
Author: njn
Date: 2005-06-26 15:48:23 +0100 (Sun, 26 Jun 2005)
New Revision: 4031
Log:
Don't include headers from headers -- make inclusions explicit in all C
files.
Modified:
trunk/coregrind/m_debuginfo/dwarf.c
trunk/coregrind/m_debuginfo/priv_symtab.h
trunk/coregrind/m_debuginfo/stabs.c
trunk/coregrind/m_debuginfo/symtab.c
Modified: trunk/coregrind/m_debuginfo/dwarf.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_debuginfo/dwarf.c 2005-06-26 14:43:01 UTC (rev 4030=
)
+++ trunk/coregrind/m_debuginfo/dwarf.c 2005-06-26 14:48:23 UTC (rev 4031=
)
@@ -29,12 +29,14 @@
*/
=20
#include "pub_core_basics.h"
+#include "pub_core_debuginfo.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_mallocfree.h"
#include "pub_core_options.h"
=20
+#include "priv_symtypes.h"
#include "priv_symtab.h"
=20
=20
Modified: trunk/coregrind/m_debuginfo/priv_symtab.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/m_debuginfo/priv_symtab.h 2005-06-26 14:43:01 UTC (re=
v 4030)
+++ trunk/coregrind/m_debuginfo/priv_symtab.h 2005-06-26 14:48:23 UTC (re=
v 4031)
@@ -31,9 +31,6 @@
#ifndef __PRIV_SYMTAB_H
#define __PRIV_SYMTAB_H
=20
-#include "pub_core_debuginfo.h"
-#include "priv_symtypes.h"
-
/* A structure to hold an ELF symbol (very crudely). */
typedef=20
struct {=20
Modified: trunk/coregrind/m_debuginfo/stabs.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_debuginfo/stabs.c 2005-06-26 14:43:01 UTC (rev 4030=
)
+++ trunk/coregrind/m_debuginfo/stabs.c 2005-06-26 14:48:23 UTC (rev 4031=
)
@@ -29,11 +29,13 @@
*/
=20
#include "pub_core_basics.h"
+#include "pub_core_debuginfo.h"
#include "pub_core_libcbase.h"
#include "pub_core_libcassert.h"
#include "pub_core_libcprint.h"
#include "pub_core_mallocfree.h"
=20
+#include "priv_symtypes.h"
#include "priv_symtab.h"
=20
#include <a.out.h> /* stabs defns */
Modified: trunk/coregrind/m_debuginfo/symtab.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_debuginfo/symtab.c 2005-06-26 14:43:01 UTC (rev 403=
0)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-26 14:48:23 UTC (rev 403=
1)
@@ -44,6 +44,8 @@
#include "pub_core_profile.h"
#include "pub_core_redir.h"
#include "pub_core_tooliface.h" // For VG_(needs).data_syms
+
+#include "priv_symtypes.h"
#include "priv_symtab.h"
=20
#include <elf.h> /* ELF defns */
|
|
From: <sv...@va...> - 2005-06-26 14:43:30
|
Author: njn
Date: 2005-06-26 15:43:01 +0100 (Sun, 26 Jun 2005)
New Revision: 4030
Log:
Killed --libc option -- can be achieved with --hide.
Now scanning .S files too.
Modified:
trunk/auxprogs/Makefile.am
trunk/auxprogs/gen-mdg
Modified: trunk/auxprogs/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/auxprogs/Makefile.am 2005-06-26 11:56:32 UTC (rev 4029)
+++ trunk/auxprogs/Makefile.am 2005-06-26 14:43:01 UTC (rev 4030)
@@ -3,5 +3,7 @@
=20
bin_PROGRAMS =3D valgrind-listener
=20
+noinst_SCRIPTS =3D gen-mdg DotToScc.hs
+
valgrind_listener_SOURCES =3D valgrind-listener.c
=20
Modified: trunk/auxprogs/gen-mdg
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/auxprogs/gen-mdg 2005-06-26 11:56:32 UTC (rev 4029)
+++ trunk/auxprogs/gen-mdg 2005-06-26 14:43:01 UTC (rev 4030)
@@ -62,7 +62,6 @@
=20
options:
--headers=3Dno|yes show headers, ie. show module-to-module deps o=
nly
- --libc=3Dno|yes show m_libc* modules
--hide=3D<a>,<b>,... hide module(s) named <a>, <b>, ...
END
;
@@ -80,11 +79,6 @@
$show_headers =3D 1 if ($1 eq "yes");
$show_headers =3D 0 if ($1 eq "no");
=20
- # --libc=3Dyes|no
- } elsif ($arg =3D~ /^--libc=3D(yes|no)$/) {
- $show_libc =3D 1 if ($1 eq "yes");
- $show_libc =3D 0 if ($1 eq "no");
-
# --hide=3D<a>,<b>,...
} elsif ($arg =3D~ /^--hide=3D(.*)$/) {
my @hiders =3D split(/,/, $1);
@@ -124,8 +118,8 @@
return $s;
}
=20
-# $module is the module to which the C file $f belongs.
-sub scan_C_file($$)
+# $module is the module to which the C/asm file $f belongs.
+sub scan_C_or_asm_file($$)
{
my ($module, $f) =3D @_;
=20
@@ -134,18 +128,13 @@
return;
}
=20
- # Skip if this is a m_libc*.c file and we aren't showing them.
- if (not $show_libc and $f =3D~ /^m_libc\w+.c/) {
- return;
- }
-
# Get any existing dependencies for this module, initialise if none
my $module_deps =3D $deps->{$module};
if (not defined $module_deps) {
$module_deps =3D {};
}
=20
- # Scan the C file
+ # Scan the C/asm file
open(CFILE, "< $f") || die "File $f not openable\n";
while (my $line =3D <CFILE>) {
if ($line =3D~ /#include\s+(("|<)[^">]+("|>))/) {
@@ -153,24 +142,24 @@
my $include_string =3D $1;
my $target;
my $realname;
- if ($include_string =3D~ /"pub_(core|tool)_([\w]+).h"/) {
+ if ($include_string =3D~ /"pub_(core|tool)_([A-Za-z]+).h"/) =
{
# If #include string is "pub_core_foo.h" or "pub_tool_fo=
o.h",=20
- # the target module is m_foo.
- $target =3D "m_$2";
- $realname =3D "";
+ # the target module is "m_foo".
+ #
+ # Nb: assuming the "foo" part does not contains undersco=
res!
+ $target =3D "m_$2";
+ $realname =3D "";
=20
- # But don't show m_libc* dst modules if asked not to.
- if (not $show_libc and $target =3D~ /m_libc/) {
- $target =3D "";
- }
-
- # And don't show hidden modules
+ # But don't show hidden modules
if ($hide{$target}) {
$target =3D "";
}
=20
} elsif ($show_headers) {
# Otherwise use the #include string as-is for the target=
.
+ # Note that "#include pub_core_foo_asm.h" falls into thi=
s
+ # category. We don't consider that part of the m_foo mo=
dule
+ # because the *_asm.h only define some constants.
$target =3D clean_nodename($include_string);
$realname =3D clean_nodelabel($include_string);
=20
@@ -209,8 +198,8 @@
}
=20
} elsif (-f $f) {
- if ($f =3D~ /\w+\.c$/) {
- # If this is a .c file in coregrind/, it's a module in i=
ts
+ if ($f =3D~ /\w+\.[cS]$/) {
+ # If this is a .c/.S file in coregrind/, it's a module i=
n its
# own right, eg. coregrind/m_redir.c --> module name of
# "m_redir".
#
@@ -220,14 +209,14 @@
my $module;
if ($parentd eq "coregrind") {
$module =3D $f;
- $module =3D~ s/(\w+).c/$1/; # foo.c --> foo
+ $module =3D~ s/(\w+).[cS]$/$1/; # foo.c --> foo
} else {
$module =3D $parentd;
}
# Now the module/f pair is either:
# - like this: (m_redir, m_redir.c)
# - or like this: (m_debuginfo, symtab.c)
- scan_C_file($module, $f);
+ scan_C_or_asm_file($module, $f);
}
=20
} else {
|
|
From: <sv...@va...> - 2005-06-26 11:57:36
|
Author: sewardj
Date: 2005-06-26 12:56:32 +0100 (Sun, 26 Jun 2005)
New Revision: 4029
Log:
Fix 32-bit-ish looking assumption.
Modified:
trunk/coregrind/stage1.c
Modified: trunk/coregrind/stage1.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/stage1.c 2005-06-26 04:49:25 UTC (rev 4028)
+++ trunk/coregrind/stage1.c 2005-06-26 11:56:32 UTC (rev 4029)
@@ -343,7 +343,7 @@
=20
/* The Linux libc startup sequence leaves this in an apparently
undefined state, but it really is defined, so mark it so. */
- VALGRIND_MAKE_READABLE(init_sp, sizeof(int));
+ VALGRIND_MAKE_READABLE(init_sp, sizeof(Word));
=20
cp =3D getenv(VALGRINDLIB);
=20
|
|
From: <sv...@va...> - 2005-06-26 04:50:25
|
Author: njn
Date: 2005-06-26 05:49:25 +0100 (Sun, 26 Jun 2005)
New Revision: 4028
Log:
Cleaned up m_redir.c: renamed some variables and functions, added some
comments, neatened the debugging output, avoided unexpected side-effects
in functions, tweaked code to make it clearer.
Modified:
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_redir.c
trunk/coregrind/pub_core_redir.h
Modified: trunk/coregrind/m_debuginfo/symtab.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_debuginfo/symtab.c 2005-06-26 02:19:17 UTC (rev 402=
7)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-26 04:49:25 UTC (rev 402=
8)
@@ -1650,7 +1650,7 @@
canonicaliseCfiSI ( si );
=20
/* do redirects */
- VG_(resolve_seg_redirs)( si );
+ VG_(resolve_existing_redirs_with_seginfo)( si );
}
VGP_POPCC(VgpReadSyms);
=20
Modified: trunk/coregrind/m_redir.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_redir.c 2005-06-26 02:19:17 UTC (rev 4027)
+++ trunk/coregrind/m_redir.c 2005-06-26 04:49:25 UTC (rev 4028)
@@ -46,6 +46,9 @@
/*--- General purpose redirection. ---*/
/*------------------------------------------------------------*/
=20
+#define TRACE_REDIR(format, args...) \
+ if (VG_(clo_trace_redir)) { VG_(message)(Vg_DebugMsg, format, ## args=
); }
+
/*
wraps and redirections, indexed by from_addr
=20
@@ -71,29 +74,24 @@
const Char *from_sym; /* symbol */
Addr from_addr; /* old addr */
=20
- /* used for redirection */
- Addr to_addr; /* new addr */
+ Addr to_addr; /* used for redirection -- new addr */
+ const FuncWrapper *wrapper; /* used for wrapping */
=20
- /* used for wrapping */
- const FuncWrapper *wrapper;
-
- CodeRedirect *next; /* next pointer on unresolved list */
+ CodeRedirect *next; /* next pointer on unresolved list */
};
=20
static Char *straddr(void *p)
{
static Char buf[16];
-
VG_(sprintf)(buf, "%p", *(Addr *)p);
-
return buf;
}
=20
-static SkipList sk_resolved_redir =3D=20
+static SkipList sk_resolved_redirs =3D=20
VG_SKIPLIST_INIT(CodeRedirect, from_addr, VG_(cmp_Addr),=20
straddr, VG_AR_SYMTAB);
=20
-static CodeRedirect *unresolved_redir =3D NULL;
+static CodeRedirect *unresolved_redirs =3D NULL;
=20
static Bool soname_matches(const Char *pattern, const Char* soname)
{
@@ -107,26 +105,32 @@
return VG_(string_match)(pattern + 7, soname);
}
=20
-static inline Bool from_resolved(const CodeRedirect *redir)
+Bool VG_(is_resolved)(const CodeRedirect *redir)
{
return redir->from_addr !=3D 0;
}
=20
-Bool VG_(is_resolved)(const CodeRedirect *redir)
+// Prepends redir to the unresolved list.
+static void add_redir_to_unresolved_list(CodeRedirect *redir)
{
- return from_resolved(redir);
+ redir->next =3D unresolved_redirs;
+ unresolved_redirs =3D redir;
}
=20
-static void add_resolved(CodeRedirect *redir)
+static void add_redir_to_resolved_list(CodeRedirect *redir)
{
- switch(redir->type) {
- case R_REDIRECT:
- if (VG_(clo_trace_redir)) {
- VG_(message)(Vg_DebugMsg, " redir resolved (%s:%s=3D%p -> ",
- redir->from_lib, redir->from_sym, redir->from_addr=
);
- VG_(message)(Vg_DebugMsg, " %p)", redir->to_ad=
dr);
- }
+ vg_assert(redir->from_addr);
=20
+ switch (redir->type) {
+ case R_REDIRECT: {
+ CodeRedirect* r;
+ =20
+ TRACE_REDIR(" redir resolved (%s:%s=3D%p -> %p)",=20
+ redir->from_lib, redir->from_sym, redir->from_addr,
+ redir->to_addr);
+
+ vg_assert(redir->to_addr !=3D 0);
+
if (VG_(search_transtab)(NULL, (Addr64)redir->from_addr, False)) {
/* For some given (from, to) redir, the "from" function got
called before the .so containing "to" became available. We
@@ -145,191 +149,173 @@
Note, this is potentially expensive -- discarding
translations causes complete unchaining. =20
*/
- if (VG_(clo_verbosity) > 2 && VG_(clo_trace_redir)) {
- VG_(message)(Vg_UserMsg, =20
- "Discarding translation due to redirect of alre=
ady called function" );
- VG_(message)(Vg_UserMsg,
- " %s (%p -> %p)",
- redir->from_sym, redir->from_addr, redir->to_ad=
dr );
- }
+ TRACE_REDIR("Discarding translation due to redirect of already =
called function" );
+ TRACE_REDIR(" %s:%s(%p) -> %p)", redir->from_lib, redir->from=
_sym,
+ redir->from_addr, redir->to_=
addr );
VG_(discard_translations)((Addr64)redir->from_addr, 1);
}
=20
- {
- CodeRedirect *r =3D VG_(SkipList_Find_Exact)(&sk_resolved_redir=
, &redir->from_addr);
+ r =3D VG_(SkipList_Find_Exact)(&sk_resolved_redirs, &redir->from_a=
ddr);
=20
- if (r =3D=3D NULL)
- VG_(SkipList_Insert)(&sk_resolved_redir, redir);
- else {
- /* XXX leak redir */
- if (VG_(clo_trace_redir))
- VG_(message)(Vg_DebugMsg, " redir %s:%s:%p->%p duplicate=
d\n",
- redir->from_lib, redir->from_sym, redir->fro=
m_addr,
- redir->to_addr);
- }
+ if (r =3D=3D NULL) {
+ VG_(SkipList_Insert)(&sk_resolved_redirs, redir);
+ } else {
+ /* XXX leak redir */
+ TRACE_REDIR(" redir %s:%s:%p->%p duplicated\n",
+ redir->from_lib, redir->from_sym, redir->from_addr,
+ redir->to_addr);
}
break;
+ }
=20
case R_WRAPPER:
- if (VG_(clo_trace_redir)) {
- VG_(message)(Vg_DebugMsg, " wrapper resolved (%s:%s=3D%p -> wr=
apper)",
- redir->from_lib, redir->from_sym, redir->from_addr=
);
- }
+ TRACE_REDIR(" wrapper resolved (%s:%s=3D%p -> wrapper)",
+ redir->from_lib, redir->from_sym, redir->from_addr);
=20
+ vg_assert(redir->wrapper);
+
/* XXX redir leaked */
//VG_(wrap_function)(redir->from_addr, redir->wrapper);
break;
=20
case R_CLIENT_WRAPPER:
+ vg_assert(redir->wrapper);
VG_(core_panic)("not implemented");
break;
}
}
=20
-/* Resolve a redir using si if possible, and add it to the resolved
- list */
-static Bool resolve_redir(CodeRedirect *redir, const SegInfo *si)
+// Resolve a redir using si if possible. Returns True if it succeeded.
+static Bool resolve_redir_with_seginfo(CodeRedirect *redir, const SegInf=
o *si)
{
- Bool resolved;
+ Bool ok;
=20
vg_assert(si !=3D NULL);
+ vg_assert(redir->from_addr =3D=3D 0 );
+ vg_assert(redir->from_sym !=3D NULL);
=20
- resolved =3D from_resolved(redir);
- vg_assert(!resolved);
- vg_assert(redir->from_sym !=3D NULL);
-
- if (soname_matches(redir->from_lib, VG_(seginfo_soname)(si))) {
+ // Resolved if the soname matches and we find the symbol.
+ ok =3D soname_matches(redir->from_lib, VG_(seginfo_soname)(si));
+ if (ok) {
redir->from_addr =3D VG_(reverse_search_one_symtab)(si, redir->fro=
m_sym);
- if (VG_(clo_trace_redir) && redir->from_addr !=3D 0)
- VG_(printf)(" bind FROM: %p =3D %s:%s\n",=20
- redir->from_addr,redir->from_lib, redir->from_sym )=
;
+ ok =3D ( redir->from_addr =3D=3D 0 ? False : True );
}
-
- resolved =3D from_resolved(redir);
-
- if (0 && VG_(clo_trace_redir))
- VG_(printf)("resolve_redir: %s:%s from=3D%p to=3D%p\n",
- redir->from_lib, redir->from_sym, redir->from_addr,=20
- redir->to_addr);
-
- if (resolved) add_resolved(redir);
-
- return resolved;
+ return ok; =20
}
=20
-static Bool resolve_redir_allsegs(CodeRedirect *redir)
+// Resolve a redir using any SegInfo if possible.
+static Bool resolve_redir_with_existing_seginfos(CodeRedirect *redir)
{
const SegInfo *si;
=20
- for(si =3D VG_(next_seginfo)(NULL);=20
- si !=3D NULL;=20
- si =3D VG_(next_seginfo)(si))
+ for (si =3D VG_(next_seginfo)(NULL);=20
+ si !=3D NULL;=20
+ si =3D VG_(next_seginfo)(si))
{
- if (resolve_redir(redir, si))
+ if (resolve_redir_with_seginfo(redir, si))
return True;
}
return False;
}
=20
-/* Go through the complete redir list, resolving as much as possible wit=
h this SegInfo.
-
- This should be called when a new SegInfo symtab is loaded.
- */
-void VG_(resolve_seg_redirs)(SegInfo *si)
+// Resolve as many unresolved redirs as possible with this SegInfo. Thi=
s
+// should be called when a new SegInfo symtab is loaded.
+void VG_(resolve_existing_redirs_with_seginfo)(SegInfo *si)
{
- CodeRedirect **prevp =3D &unresolved_redir;
+ CodeRedirect **prevp =3D &unresolved_redirs;
CodeRedirect *redir, *next;
=20
- if (VG_(clo_trace_redir))
- VG_(printf)("Considering redirs to/from %s(soname=3D%s)\n",
- VG_(seginfo_filename)(si), VG_(seginfo_soname)(si));
+ TRACE_REDIR("Just loaded %s (soname=3D%s),",
+ VG_(seginfo_filename)(si), VG_(seginfo_soname)(si));
+ TRACE_REDIR(" resolving any unresolved redirs with it");
=20
- /* visit each unresolved redir - if it becomes resolved, then
- remove it from the unresolved list */
- for(redir =3D unresolved_redir; redir !=3D NULL; redir =3D next) {
+ // Visit each unresolved redir - if it becomes resolved, then
+ // move it from the unresolved list to the resolved list.
+ for (redir =3D unresolved_redirs; redir !=3D NULL; redir =3D next) {
next =3D redir->next;
=20
- if (resolve_redir(redir, si)) {
+ if (resolve_redir_with_seginfo(redir, si)) {
*prevp =3D next;
redir->next =3D NULL;
+ add_redir_to_resolved_list(redir);
} else
prevp =3D &redir->next;
}
+
+ TRACE_REDIR(" Finished resolving");
}
=20
-static void add_redirect_X_to_addr(
- const Char *from_lib, const Char *from_sym, Addr from_addr, Addr to_a=
ddr
-)
+/* Redirect a function at from_addr to a function at to_addr */
+__attribute__((unused)) // It is used, but not on all platforms...
+static void add_redirect_addr_to_addr( Addr from_addr, Addr to_addr )
{
- CodeRedirect *redir =3D VG_(SkipNode_Alloc)(&sk_resolved_redir);
+ CodeRedirect *redir =3D VG_(SkipNode_Alloc)(&sk_resolved_redirs);
=20
- redir->type =3D R_REDIRECT;
+ vg_assert(0 !=3D from_addr && 0 !=3D to_addr);
=20
- if (from_lib) redir->from_lib =3D VG_(arena_strdup)(VG_AR_SYMTAB, fr=
om_lib);
- else redir->from_lib =3D NULL;
- if (from_sym) redir->from_sym =3D VG_(arena_strdup)(VG_AR_SYMTAB, fr=
om_sym);
- else redir->from_sym =3D NULL;
- =20
+ redir->type =3D R_REDIRECT;
+
+ redir->from_lib =3D NULL;
+ redir->from_sym =3D NULL;
redir->from_addr =3D from_addr;
=20
- vg_assert(0 !=3D to_addr);
- redir->to_addr =3D to_addr;
- redir->wrapper =3D 0;
+ redir->to_addr =3D to_addr;
+ redir->wrapper =3D 0;
=20
- if (VG_(clo_verbosity) >=3D 2 && VG_(clo_trace_redir))
- VG_(message)(Vg_UserMsg,=20
- "REDIRECT %s:%s(%p) to %p",
- from_lib, from_sym, from_addr, to_addr);
+ TRACE_REDIR("REDIRECT addr to addr: %p to %p", from_addr, to_addr);
=20
- /* Check against all existing segments to see if this redirection
- can be resolved immediately */
- if (VG_(is_resolved)(redir)) {
- add_resolved(redir);
- }
- else if (!resolve_redir_allsegs(redir)) {
- /* nope, add to list */
- redir->next =3D unresolved_redir;
- unresolved_redir =3D redir;
- }
+ // This redirection is already resolved, put it straight in the list.
+ add_redir_to_resolved_list(redir);
}
=20
/* Redirect a lib/symbol reference to a function at addr */
-static void add_redirect_sym_to_addr(const Char *from_lib, const Char *f=
rom_sym,
- Addr to_addr)
+static void add_redirect_sym_to_addr(
+ const Char *from_lib, const Char *from_sym, Addr to_addr
+)
{
- add_redirect_X_to_addr(from_lib, from_sym, 0, to_addr);
-}
+ CodeRedirect *redir =3D VG_(SkipNode_Alloc)(&sk_resolved_redirs);
=20
-/* Redirect a function at from_addr to a function at to_addr */
-__attribute__((unused)) // It is used, but not on all platforms...
-static void add_redirect_addr_to_addr(Addr from_addr, Addr to_addr)
-{
- add_redirect_X_to_addr(NULL, NULL, from_addr, to_addr);
+ vg_assert(from_lib && from_sym && 0 !=3D to_addr);
+
+ redir->type =3D R_REDIRECT;
+ redir->from_lib =3D VG_(arena_strdup)(VG_AR_SYMTAB, from_lib);
+ redir->from_sym =3D VG_(arena_strdup)(VG_AR_SYMTAB, from_sym);
+ redir->from_addr =3D 0;
+ redir->to_addr =3D to_addr;
+ redir->wrapper =3D 0;
+
+ TRACE_REDIR("REDIR sym to addr: %s:%s to %p", from_lib, from_sym, to_=
addr);
+
+ // Check against all existing segments to see if this redirection
+ // can be resolved immediately. Then add it to the appropriate list.
+ if (resolve_redir_with_existing_seginfos(redir)) {
+ add_redir_to_resolved_list(redir);
+ } else {
+ add_redir_to_unresolved_list(redir);
+ }
}
=20
CodeRedirect *VG_(add_wrapper)(const Char *from_lib, const Char *from_sy=
m,
const FuncWrapper *wrapper)
{
- CodeRedirect *redir =3D VG_(SkipNode_Alloc)(&sk_resolved_redir);
+ CodeRedirect *redir =3D VG_(SkipNode_Alloc)(&sk_resolved_redirs);
=20
- if (0)
- VG_(printf)("adding wrapper for %s:%s -> (%p,%p)\n",
- from_lib, from_sym, wrapper->before, wrapper->after);
-
- redir->type =3D R_WRAPPER;
-
+ redir->type =3D R_WRAPPER;
redir->from_lib =3D VG_(arena_strdup)(VG_AR_SYMTAB, from_lib);
redir->from_sym =3D VG_(arena_strdup)(VG_AR_SYMTAB, from_sym);
redir->from_addr =3D 0;
redir->to_addr =3D 0;
redir->wrapper =3D wrapper;
=20
- /* Check against all existing segments to see if this redirection
- can be resolved immediately */
- if (!resolve_redir_allsegs(redir)) {
- /* nope, add to list */
- redir->next =3D unresolved_redir;
- unresolved_redir =3D redir;
+ TRACE_REDIR("REDIR sym to wrapper: %s:%s to (%p,%p)",
+ from_lib, from_sym, wrapper->before, wrapper->after);
+
+ // Check against all existing segments to see if this redirection
+ // can be resolved immediately. Then add it to the appropriate list.
+ if (resolve_redir_with_existing_seginfos(redir)) {
+ add_redir_to_resolved_list(redir);
+ } else {
+ add_redir_to_unresolved_list(redir);
}
=20
return redir;
@@ -341,7 +327,7 @@
{
CodeRedirect* r;
=20
- r =3D VG_(SkipList_Find_Exact)(&sk_resolved_redir, &a);
+ r =3D VG_(SkipList_Find_Exact)(&sk_resolved_redirs, &a);
if (r =3D=3D NULL)
return a;
=20
Modified: trunk/coregrind/pub_core_redir.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_redir.h 2005-06-26 02:19:17 UTC (rev 4027)
+++ trunk/coregrind/pub_core_redir.h 2005-06-26 04:49:25 UTC (rev 4028)
@@ -71,7 +71,7 @@
/* Set up some default redirects */
extern void VG_(setup_code_redirect_table) ( void );
=20
-extern void VG_(resolve_seg_redirs)(SegInfo *si);
+extern void VG_(resolve_existing_redirs_with_seginfo)(SegInfo *si);
=20
=20
//--------------------------------------------------------------------
|
|
From: Tom H. <th...@cy...> - 2005-06-26 03:02:24
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-06-26 03:25:01 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 == 177 tests, 11 stderr failures, 2 stdout failures ================= memcheck/tests/error_counts (stdout) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/pth_cancel1 (stdout) corecheck/tests/pth_cancel1 (stderr) corecheck/tests/pth_cancel2 (stderr) none/tests/faultstatus (stderr) none/tests/pth_blockedsig (stderr) none/tests/x86/int (stderr) |
|
From: <js...@ac...> - 2005-06-26 02:42:12
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-26 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 == 175 tests, 4 stderr failures, 1 stdout failure ================= memcheck/tests/error_counts (stdout) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-tree (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <to...@co...> - 2005-06-26 02:32:55
|
Nightly build on dunsmere ( athlon, Fedora Core 4 ) started at 2005-06-26 03:30:04 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 Last 20 lines of log.verbose follow insn_fpu.c: In function 'fsubrl_1': insn_fpu.c:16391: error: unknown register name 'mm6' in 'asm' insn_fpu.c: In function 'fsubrl_2': insn_fpu.c:16429: error: unknown register name 'mm6' in 'asm' insn_fpu.c: In function 'fsubrl_3': insn_fpu.c:16467: error: unknown register name 'mm6' in 'asm' insn_fpu.c: In function 'fsubrl_4': insn_fpu.c:16505: error: unknown register name 'mm6' in 'asm' make[5]: *** [insn_fpu.o] Error 1 rm insn_fpu.c insn_basic.c make[5]: Leaving directory `/tmp/valgrind.8013/valgrind/none/tests/x86' make[4]: *** [check-am] Error 2 make[4]: Leaving directory `/tmp/valgrind.8013/valgrind/none/tests/x86' make[3]: *** [check-recursive] Error 1 make[3]: Leaving directory `/tmp/valgrind.8013/valgrind/none/tests' make[2]: *** [check-recursive] Error 1 make[2]: Leaving directory `/tmp/valgrind.8013/valgrind/none' make[1]: *** [check-recursive] Error 1 make[1]: Leaving directory `/tmp/valgrind.8013/valgrind' make: *** [check] Error 2 |
|
From: Tom H. <th...@cy...> - 2005-06-26 02:21:00
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-06-26 03:15:03 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 == 176 tests, 12 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/error_counts (stdout) 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/pointer-trace (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: <sv...@va...> - 2005-06-26 02:19:21
|
Author: njn
Date: 2005-06-26 03:19:17 +0100 (Sun, 26 Jun 2005)
New Revision: 4027
Log:
If read_lib_symbols() fails, once again discard the SegInfo.
And some other minor cleanups.
Modified:
trunk/coregrind/m_debuginfo/priv_symtab.h
trunk/coregrind/m_debuginfo/symtab.c
Modified: trunk/coregrind/m_debuginfo/priv_symtab.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/m_debuginfo/priv_symtab.h 2005-06-26 00:44:21 UTC (re=
v 4026)
+++ trunk/coregrind/m_debuginfo/priv_symtab.h 2005-06-26 02:19:17 UTC (re=
v 4027)
@@ -171,7 +171,7 @@
struct _SegInfo {
struct _SegInfo* next; /* list of SegInfos */
=20
- Int ref;
+ Int ref;
=20
/* Description of the mapped segment. */
Addr start;
Modified: trunk/coregrind/m_debuginfo/symtab.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_debuginfo/symtab.c 2005-06-26 00:44:21 UTC (rev 402=
6)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-26 02:19:17 UTC (rev 402=
7)
@@ -48,6 +48,12 @@
=20
#include <elf.h> /* ELF defns */
=20
+/* The root structure for the entire symbol table system. It is a
+ linked list of SegInfos. Note that this entire mechanism assumes
+ that what we read from /proc/self/maps doesn't contain overlapping
+ address ranges, and as a result the SegInfos in this list describe
+ disjoint address ranges.=20
+*/
static SegInfo* segInfo_list =3D NULL;
=20
/*------------------------------------------------------------*/
@@ -1290,12 +1296,15 @@
=20
si->offset =3D 0;
=20
+ vg_assert(si->soname =3D=3D NULL);
+
for (i =3D 0; i < ehdr->e_phnum; i++) {
ElfXX_Phdr *o_phdr;
ElfXX_Addr mapped, mapped_end;
=20
o_phdr =3D &((ElfXX_Phdr *)(oimage + ehdr->e_phoff))[i];
=20
+ // Try to get the soname.
if (o_phdr->p_type =3D=3D PT_DYNAMIC && si->soname =3D=3D NULL) {
const ElfXX_Dyn *dyn =3D (const ElfXX_Dyn *)(oimage + o_phdr->p_off=
set);
Int stroff =3D -1;
@@ -1329,15 +1338,16 @@
baseaddr =3D o_phdr->p_vaddr;
}
=20
+ // Make sure the Phdrs are in order
if (o_phdr->p_vaddr < prev_addr) {
ML_(symerr)("ELF Phdrs are out of order!?");
goto out;
}
prev_addr =3D o_phdr->p_vaddr;
=20
+ // Get the data and bss start/size if appropriate
mapped =3D o_phdr->p_vaddr + si->offset;
mapped_end =3D mapped + o_phdr->p_memsz;
-
if (si->data_start =3D=3D 0 &&
(o_phdr->p_flags & (PF_R|PF_W|PF_X)) =3D=3D (PF_R|PF_W)) {
si->data_start =3D mapped;
@@ -1348,14 +1358,13 @@
else
si->bss_size =3D 0;
}
-
- mapped =3D mapped & ~(VKI_PAGE_SIZE-1);
- mapped_end =3D (mapped_end + VKI_PAGE_SIZE - 1) & ~(VKI_PAGE_SIZE-1);
-
#if 0
/* 20050228: disabled this until VG_(next_segment) can be
reinstated in some clean incarnation of the low level
memory manager. */
+ mapped =3D mapped & ~(VKI_PAGE_SIZE-1);
+ mapped_end =3D (mapped_end + VKI_PAGE_SIZE - 1) & ~(VKI_PAGE_SIZE-1);
+
if (VG_(needs).data_syms &&
(mapped >=3D si->start && mapped <=3D (si->start+si->size)) &&
(mapped_end > (si->start+si->size))) {
@@ -1444,8 +1453,6 @@
Addr dummy_addr =3D 0;
Addr ehframe_addr =3D 0;
=20
- Bool has_debuginfo =3D False;
-
/* Find all interesting sections */
for (i =3D 0; i < ehdr->e_shnum; i++) {
# define FIND(sec_name, sec_data, sec_size, sec_addr, in_exec, ty=
pe) \
@@ -1567,14 +1574,12 @@
appears reading stabs stuff on amd64-linux doesn't work, so
we ignore it. */
# if !defined(VGP_amd64_linux)
- if (stab !=3D NULL && stabstr !=3D NULL) {
- has_debuginfo =3D True;
+ if (stab && stabstr) {
ML_(read_debuginfo_stabs) ( si, stab, stab_sz,=20
stabstr, stabstr_sz );
}
# endif
if (debug_line) {
- has_debuginfo =3D True;
ML_(read_debuginfo_dwarf2) ( si,=20
debug_info, debug_info_sz,
debug_abbv,
@@ -1582,13 +1587,8 @@
debug_str );
}
if (dwarf1d && dwarf1l) {
- has_debuginfo =3D True;
ML_(read_debuginfo_dwarf1) ( si, dwarf1d, dwarf1d_sz,=20
dwarf1l, dwarf1l_sz );
- }=20
- if (!has_debuginfo) {
- ML_(symerr)(" object doesn't have any line number info");
- goto out;
}
}
res =3D True;
@@ -1610,61 +1610,35 @@
/*--- Main entry point for symbols table reading. ---*/
/*------------------------------------------------------------*/
=20
-/* The root structure for the entire symbol table system. It is a
- linked list of SegInfos. Note that this entire mechanism assumes
- that what we read from /proc/self/maps doesn't contain overlapping
- address ranges, and as a result the SegInfos in this list describe
- disjoint address ranges.=20
-*/
-SegInfo *VG_(read_seg_symbols) ( Addr seg_addr, SizeT seg_len,
- OffT seg_offset, const Char* seg_filena=
me)
+static SegInfo*
+alloc_SegInfo(Addr start, SizeT size, OffT foffset, const Char* filename=
)
{
- SegInfo* si;
+ SegInfo* si =3D VG_(arena_calloc)(VG_AR_SYMTAB, 1, sizeof(SegInfo));
=20
- VGP_PUSHCC(VgpReadSyms);
+ si->start =3D start;
+ si->size =3D size;
+ si->foffset =3D foffset;
+ si->filename =3D VG_(arena_strdup)(VG_AR_SYMTAB, filename);
=20
- /* Get the record initialised right. */
- si =3D VG_(arena_malloc)(VG_AR_SYMTAB, sizeof(SegInfo));
-
- VG_(memset)(si, 0, sizeof(*si));
- si->start =3D seg_addr;
- si->size =3D seg_len;
- si->foffset =3D seg_offset;
- si->filename =3D VG_(arena_strdup)(VG_AR_SYMTAB, seg_filename);
-
si->ref =3D 1;
=20
- si->symtab =3D NULL;
- si->symtab_size =3D si->symtab_used =3D 0;
- si->loctab =3D NULL;
- si->loctab_size =3D si->loctab_used =3D 0;
- si->strchunks =3D NULL;
- si->scopetab =3D NULL;
- si->scopetab_size =3D si->scopetab_used =3D 0;
- si->cfisi =3D NULL;
- si->cfisi_size =3D si->cfisi_used =3D 0;
- si->cfisi_minaddr =3D si->cfisi_maxaddr =3D 0;
+ // Everything else -- pointers, sizes, arrays -- is zeroed by calloc.
=20
- si->stab_typetab =3D NULL;
+ return si;
+}
=20
- si->plt_start =3D si->plt_size =3D 0;
- si->got_start =3D si->got_size =3D 0;
- si->data_start =3D si->data_size =3D 0;
- si->bss_start =3D si->bss_size =3D 0;
+SegInfo *VG_(read_seg_symbols) ( Addr seg_addr, SizeT seg_len,
+ OffT seg_offset, const Char* seg_filena=
me)
+{
+ SegInfo* si =3D alloc_SegInfo(seg_addr, seg_len, seg_offset, seg_file=
name);
=20
- /* And actually fill it up. */
- if (!read_lib_symbols ( si ) && 0) {
- /* XXX this interacts badly with the prevN optimization in
- addStr(). Since this frees the si, the si pointer value can
- be recycled, which confuses the curr_si =3D=3D si test. For no=
w,
- this code is disabled, and everything is included in the
- segment list, even if it is a bad ELF file. Ironically,
- running this under valgrind itself hides the problem, because
- it doesn't recycle pointers... */
- // [Nb: the prevN optimization has now been removed from addStr().
- // However, when I try reactivating this path of the branch I get
- // seg faults... --njn 13-Jun-2005]
+ VGP_PUSHCC(VgpReadSyms);
+
+ if (!read_lib_symbols ( si )) {
+ // Something went wrong (eg. bad ELF file).
freeSegInfo( si );
+ si =3D NULL;
+
} else {
// Prepend si to segInfo_list
si->next =3D segInfo_list;
|
|
From: Tom H. <th...@cy...> - 2005-06-26 02:05:43
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-06-26 03:00:03 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 == 157 tests, 13 stderr failures, 2 stdout failures ================= memcheck/tests/brk (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/leak-0 (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/strchr (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_fcntl (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) |
|
From: Julian S. <js...@ac...> - 2005-06-26 01:50:40
|
[to continue an old discussion ..] >On Saturday 02 April 2005 00:32, Jeremy Fitzhardinge wrote: > Nicholas Nethercote wrote: > > And then we wouldn't need dlopen() at all, right? > > Well, we'd still need it to get stage2 into the right place, unless we > can use some linker magic to get it there first shot; I've tried doing > this before, but its very hard to get right, and extremely hard to make > it work over a wide range of toolchain versions (and that's just > binutils). Suppose stage2 is statically linked, including the relevant tool, and is linked to load at some non-standard address, the latter as at present. Then there would be no need for stage1 at all, and no need for address space padding/unpadding. Is that correct? J |
|
From: <sv...@va...> - 2005-06-26 00:45:23
|
Author: njn
Date: 2005-06-26 01:44:21 +0100 (Sun, 26 Jun 2005)
New Revision: 4026
Log:
Allow multiple module names per --hide option.
Modified:
trunk/auxprogs/gen-mdg
Modified: trunk/auxprogs/gen-mdg
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/auxprogs/gen-mdg 2005-06-25 20:49:33 UTC (rev 4025)
+++ trunk/auxprogs/gen-mdg 2005-06-26 00:44:21 UTC (rev 4026)
@@ -63,7 +63,7 @@
options:
--headers=3Dno|yes show headers, ie. show module-to-module deps o=
nly
--libc=3Dno|yes show m_libc* modules
- --hide=3D<module> hide module named <module>
+ --hide=3D<a>,<b>,... hide module(s) named <a>, <b>, ...
END
;
=20
@@ -85,9 +85,12 @@
$show_libc =3D 1 if ($1 eq "yes");
$show_libc =3D 0 if ($1 eq "no");
=20
- # --hide=3D<module>
+ # --hide=3D<a>,<b>,...
} elsif ($arg =3D~ /^--hide=3D(.*)$/) {
- $hide{$1} =3D 1;
+ my @hiders =3D split(/,/, $1);
+ foreach my $h (@hiders) {
+ $hide{$h} =3D 1;
+ }
=20
} else {
die $usage;
|