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: Jeremy F. <je...@go...> - 2005-06-01 22:07:34
|
Josef Weidendorfer wrote:
>Now I have a bug report with an assertion because my data structures are
>getting corrupted. Looking at it, I see that there is an signal handler
>switching thread via SK_(pre_deliver_signal)(ThreadId tid, ...), and on
>returning, the previous running thread seems to be resumed, but I do not get
>any callback (e.g. via thread_run) that there is a thread context switch
>after the signal handler.
>
>
Yep, that looks like a bug. There should be a call to
VG_(tm_thread_switchto)(tid); in vg_async_signalhandler(), though
perhaps VG_(set_running)() should always call it.
>Or accessing all per-thread data always via indirection, calling
>VG_(get_current_or_recent_tid)() everytime. I assume this will give some
>performance hit.
>
>
That will work, and its how other tools keep track of per-thread info.
It isn't particularly slow, so I would try it and see.
J
|
|
From: Nicholas N. <nj...@cs...> - 2005-06-01 18:13:03
|
On Wed, 1 Jun 2005, Cerion Armour-Brown wrote: > On Wednesday 01 June 2005 00:55, Nicholas Nethercote wrote: >> So the follow-up question: how do we make Subversion include the Mime >> version line? > > Added the line to the post-commit hook commit-email.pl It works! Thanks. N |
|
From: <sv...@va...> - 2005-06-01 17:35:28
|
Author: sewardj
Date: 2005-06-01 18:35:23 +0100 (Wed, 01 Jun 2005)
New Revision: 3837
Modified:
trunk/README_XML_OUTPUT.txt
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_errormgr.c
trunk/coregrind/m_main.c
Log:
Minor refinements/bug-fixes to XML printing.
Modified: trunk/README_XML_OUTPUT.txt
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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/README_XML_OUTPUT.txt 2005-06-01 04:07:56 UTC (rev 3836)
+++ trunk/README_XML_OUTPUT.txt 2005-06-01 17:35:23 UTC (rev 3837)
@@ -86,6 +86,7 @@
created by future versions of Valgrind merely by observing that the
protocol version is one they don't understand. Hence TOPLEVEL is:
=20
+ <?xml version=3D"1.0"?>
<valgrindoutput>
<protocolversion>INT<protocolversion>
VERSION1STUFF
@@ -117,12 +118,11 @@
=20
<tool>TEXT</tool>
=20
-* The program and args being run. Note, the program name is not
- distinguished; it is merely the first presented TEXT:
+* The program and args being run.
=20
<argv>
- <arg>TEXT</arg>
- (one or more of)
+ <exe>TEXT</exe>
+ <arg>TEXT</arg> (zero or more of)
</argv>
=20
* The following, indicating that the program has now started:
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-01 04:07:56 UTC (rev 383=
6)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-01 17:35:23 UTC (rev 383=
7)
@@ -2448,29 +2448,39 @@
=20
if (VG_(clo_xml)) {
=20
+ Bool human_readable =3D True;
+ HChar* maybe_newline =3D human_readable ? "\n " : "";
+ HChar* maybe_newline2 =3D human_readable ? "\n " : "";
+
/* Print in XML format, dumping in as much info as we know. */
APPEND("<frame>");
VG_(sprintf)(ibuf,"<ip>0x%llx</ip>", (ULong)eip);
+ APPEND(maybe_newline);
APPEND(ibuf);
if (know_objname) {
+ APPEND(maybe_newline);
APPEND("<obj>");
APPEND(buf_obj);
APPEND("</obj>");
}
if (know_fnname) {
+ APPEND(maybe_newline);
APPEND("<fn>");
APPEND(buf_fn);
APPEND("</fn>");
}
if (know_srcloc) {
+ APPEND(maybe_newline);
APPEND("<file>");
APPEND(buf_srcloc);
APPEND("</file>");
+ APPEND(maybe_newline);
APPEND("<line>");
VG_(sprintf)(ibuf,"%d",lineno);
APPEND(ibuf);
APPEND("</line>");
}
+ APPEND(maybe_newline2);
APPEND("</frame>");
=20
} else {
Modified: trunk/coregrind/m_errormgr.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_errormgr.c 2005-06-01 04:07:56 UTC (rev 3836)
+++ trunk/coregrind/m_errormgr.c 2005-06-01 17:35:23 UTC (rev 3837)
@@ -660,7 +660,10 @@
any_supp =3D True;
if (VG_(clo_xml)) {
VG_(message)(Vg_DebugMsg,=20
- " <pair><count>%d</count><name>%s</name></pair>",=
=20
+ " <pair>\n"
+ " <count>%d</count>\n"
+ " <name>%s</name>\n"
+ " </pair>",=20
su->count, su->sname);
} else {
VG_(message)(Vg_DebugMsg, "supp: %4d %s", su->count, su->sname)=
;
@@ -668,7 +671,7 @@
}
=20
if (VG_(clo_xml))
- VG_(message)(Vg_DebugMsg, "<suppcounts>");
+ VG_(message)(Vg_DebugMsg, "</suppcounts>");
=20
return any_supp;
}
@@ -772,8 +775,8 @@
if (err->count <=3D 0)
continue;
VG_(message)(
- Vg_UserMsg, " <pair><count>%d</count>"
- "<unique>0x%llx</unique></pair>",
+ Vg_UserMsg, " <pair> <count>%d</count> "
+ "<unique>0x%llx</unique> </pair>",
err->count, Ptr_to_ULong(err)
);
}
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-01 04:07:56 UTC (rev 3836)
+++ trunk/coregrind/m_main.c 2005-06-01 17:35:23 UTC (rev 3837)
@@ -1924,6 +1924,8 @@
=20
if (VG_(clo_xml)) {
VG_(message)(Vg_UserMsg, "");
+ VG_(message)(Vg_UserMsg, "<?xml version=3D\"1.0\"?>");
+ VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<valgrindoutput>");
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<protocolversion>1</protocolversion>");
@@ -1977,8 +1979,11 @@
VG_(message)(Vg_UserMsg, "<tool>%s</tool>", toolname);
VG_(message)(Vg_UserMsg, "");
VG_(message)(Vg_UserMsg, "<argv>"); =20
- for (i =3D 0; i < VG_(client_argc); i++)=20
- VG_(message)(Vg_UserMsg, " <arg>%s</arg>", VG_(client_argv)[i]=
);
+ for (i =3D 0; i < VG_(client_argc); i++) {
+ HChar* tag =3D i=3D=3D0 ? "exe" : "arg";
+ VG_(message)(Vg_UserMsg, " <%s>%s</%s>",=20
+ tag, VG_(client_argv)[i], tag);
+ }
VG_(message)(Vg_UserMsg, "</argv>"); =20
}
=20
|
|
From: Josef W. <Jos...@gm...> - 2005-06-01 14:59:48
|
On Wednesday 01 June 2005 00:16, you wrote: > Josef Weidendorfer wrote: > In general, signals do not explicitly cause thread context switches. A > thread may become runnable because it received a signal, but it is no > different from any other reason a thread may become runnable (like a > syscall unblocking). Likewise, returning from a signal doesn't > explicitly cause a thread context switch. > > A signal handler isn't special in any way, so there's always a chance > you can get a context switch in a signal handler. > > What problem are you seeing? In my tool, I have global pointers to per-thread data structures. These pointers need to be updated on a thread context switch. I track context switches via callbacks SK_(thread_run)(ThreadId tid) and SK_(pre_deliver_signal)(ThreadId tid, ...) for switches before entering a signal handler. Now I have a bug report with an assertion because my data structures are getting corrupted. Looking at it, I see that there is an signal handler switching thread via SK_(pre_deliver_signal)(ThreadId tid, ...), and on returning, the previous running thread seems to be resumed, but I do not get any callback (e.g. via thread_run) that there is a thread context switch after the signal handler. If I restore the thread context which has executed before the signal handler, the assertion is gone for a small test case, but not for a more complex one. So this is no general solution if there can be context switches in a signal handler. The thing I need is a SK_(thread_run) callback after the signal handler if thread contexts are switching, and this is missing currently. I.e. it would be good to be able to track the current TID always via callbacks. But I need a solution which works with current VG releases. Perhaps setting the tracked TID to 0 after a signal handler is finished would be a possibility. Then, before any per-thread structure is accessed, the actual TID is looked up lazily via VG_(get_current_or_recent_tid)(), and the global pointers are corrected accordingly. Or accessing all per-thread data always via indirection, calling VG_(get_current_or_recent_tid)() everytime. I assume this will give some performance hit. Josef |
|
From: Cerion Armour-B. <ce...@op...> - 2005-06-01 11:04:23
|
On Wednesday 01 June 2005 00:55, Nicholas Nethercote wrote: > So the follow-up question: how do we make Subversion include the Mime > version line? Added the line to the post-commit hook commit-email.pl C. |
|
From: Julian S. <js...@ac...> - 2005-06-01 09:41:54
|
Author: sewardj Date: 2005-05-31 21:01:34 +0100 (Tue, 31 May 2005) New Revision: 3827 Added: trunk/memcheck/tests/x86/scalar.stderr.exp2 trunk/memcheck/tests/x86/scalar_exit_group.stderr.exp2 trunk/memcheck/tests/x86/scalar_supp.stderr.exp2 Modified: trunk/memcheck/tests/x86/Makefile.am Log: More expected outputs for FC4. [... giant diff deleted ...] |
|
From: Julian S. <js...@ac...> - 2005-06-01 09:40:29
|
Author: njn Date: 2005-05-31 03:38:09 +0100 (Tue, 31 May 2005) New Revision: 3821 Added: trunk/coregrind/m_debuginfo/ trunk/coregrind/m_debuginfo/Makefile.am trunk/coregrind/m_debuginfo/dwarf.c trunk/coregrind/m_debuginfo/priv_symtab.h trunk/coregrind/m_debuginfo/priv_symtypes.h trunk/coregrind/m_debuginfo/stabs.c trunk/coregrind/m_debuginfo/symtab.c trunk/coregrind/m_debuginfo/symtypes.c trunk/coregrind/pub_core_debuginfo.h trunk/include/pub_tool_debuginfo.h Removed: trunk/coregrind/vg_dwarf.c trunk/coregrind/vg_stabs.c trunk/coregrind/vg_symtab2.c trunk/coregrind/vg_symtab2.h trunk/coregrind/vg_symtypes.c trunk/coregrind/vg_symtypes.h Modified: trunk/cachegrind/cg_main.c trunk/configure.in trunk/coregrind/Makefile.am trunk/coregrind/core.h trunk/coregrind/m_errormgr.c trunk/coregrind/m_redir.c trunk/coregrind/m_transtab.c trunk/coregrind/pub_core_aspacemgr.h trunk/helgrind/hg_main.c trunk/include/tool.h trunk/massif/ms_main.c Log: Modularised all the debug info stuff as m_debuginfo/. It's a mess and needs further cleaning up, but it's a start. [... giant diff deleted ...] |
|
From: Julian S. <js...@ac...> - 2005-06-01 09:39:02
|
Author: njn Date: 2005-05-31 02:00:08 +0100 (Tue, 31 May 2005) New Revision: 3820 Added: trunk/coregrind/m_signals.c trunk/coregrind/pub_core_signals.h Removed: trunk/coregrind/vg_signals.c Modified: trunk/coregrind/Makefile.am trunk/coregrind/core.h trunk/coregrind/linux/core_os.c trunk/coregrind/m_main.c trunk/coregrind/m_scheduler/scheduler.c trunk/coregrind/m_sigframe/sigframe-amd64-linux.c trunk/coregrind/m_sigframe/sigframe-x86-linux.c trunk/coregrind/m_syscalls/priv_syscalls.h trunk/coregrind/m_translate.c Log: Modularised vg_signals.c as m_signals.c. [... giant diff deleted ...] |
|
From: <sv...@va...> - 2005-06-01 04:08:01
|
Author: njn Date: 2005-06-01 05:07:56 +0100 (Wed, 01 Jun 2005) New Revision: 3836 Modified: trunk/coregrind/core.h Log: Remove dead macro. Modified: trunk/coregrind/core.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/core.h 2005-06-01 04:06:55 UTC (rev 3835) +++ trunk/coregrind/core.h 2005-06-01 04:07:56 UTC (rev 3836) @@ -224,7 +224,6 @@ #define CLREQ_RET(regs) ((regs).vex.VGA_CLREQ_RET) // Offsets for the Vex state #define O_STACK_PTR (offsetof(VexGuestArchState, VGA_STACK_PTR)) -#define O_FRAME_PTR (offsetof(VexGuestArchState, VGA_FRAME_PTR)) #define O_CLREQ_RET (offsetof(VexGuestArchState, VGA_CLREQ_RET)) =20 =20 |
|
From: <sv...@va...> - 2005-06-01 04:06:57
|
Author: njn
Date: 2005-06-01 05:06:55 +0100 (Wed, 01 Jun 2005)
New Revision: 3835
Modified:
trunk/coregrind/core.h
trunk/coregrind/pub_core_options.h
Log:
Move VALGRINDCLO and VALGRINDOPTS into m_options.
Modified: trunk/coregrind/core.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/core.h 2005-06-01 03:48:33 UTC (rev 3834)
+++ trunk/coregrind/core.h 2005-06-01 04:06:55 UTC (rev 3835)
@@ -64,25 +64,6 @@
/* The directory we look for all our auxillary files in */
#define VALGRINDLIB "VALGRINDLIB"
=20
-/* Additional command-line arguments; they are overridden by actual
- command-line option. Each argument is separated by spaces. There
- is no quoting mechanism.
- */
-#define VALGRINDOPTS "VALGRIND_OPTS"
-
-/* If this variable is present in the environment, then valgrind will
- not parse the command line for options at all; all options come
- from this variable. Arguments are terminated by ^A (\001). There
- is no quoting mechanism.
-
- This variable is not expected to be set by anything other than
- Valgrind itself, as part of its handling of execve with
- --trace-children=3Dyes. This variable should not be present in the
- client environment.
- */
-#define VALGRINDCLO "_VALGRIND_CLO"
-
-
/* Application-visible file descriptor limits */
extern Int VG_(fd_soft_limit);
extern Int VG_(fd_hard_limit);
Modified: trunk/coregrind/pub_core_options.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_options.h 2005-06-01 03:48:33 UTC (rev 3834)
+++ trunk/coregrind/pub_core_options.h 2005-06-01 04:06:55 UTC (rev 3835)
@@ -39,6 +39,22 @@
=20
#include "pub_tool_options.h"
=20
+/* Additional command-line arguments; they are overridden by actual
+ command-line option. Each argument is separated by spaces. There
+ is no quoting mechanism. */
+#define VALGRINDOPTS "VALGRIND_OPTS"
+
+/* If this variable is present in the environment, then valgrind will
+ not parse the command line for options at all; all options come
+ from this variable. Arguments are terminated by ^A (\001). There
+ is no quoting mechanism.
+
+ This variable is not expected to be set by anything other than
+ Valgrind itself, as part of its handling of execve with
+ --trace-children=3Dyes. This variable should not be present in the
+ client environment. */
+#define VALGRINDCLO "_VALGRIND_CLO"
+
/* Default destination port to be used in logging over a network, if
none specified. */
#define VG_CLO_DEFAULT_LOGPORT 1500
|
|
From: <sv...@va...> - 2005-06-01 03:48:41
|
Author: njn
Date: 2005-06-01 04:48:33 +0100 (Wed, 01 Jun 2005)
New Revision: 3834
Modified:
trunk/coregrind/amd64/state.c
trunk/coregrind/core.h
trunk/coregrind/m_aspacemgr/aspacemgr.c
trunk/coregrind/pub_core_aspacemgr.h
trunk/coregrind/x86/state.c
Log:
Moved VGA_(pointercheck)() into ASpaceMgr.
Modified: trunk/coregrind/amd64/state.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/amd64/state.c 2005-06-01 03:09:59 UTC (rev 3833)
+++ trunk/coregrind/amd64/state.c 2005-06-01 03:48:33 UTC (rev 3834)
@@ -112,18 +112,6 @@
=20
=20
/*------------------------------------------------------------*/
-/*--- pointercheck ---*/
-/*------------------------------------------------------------*/
-
-Bool VGA_(setup_pointercheck)(Addr client_base, Addr client_end)
-{
- vg_assert(0 !=3D client_end);
- if (0)=20
- VG_(message)(Vg_DebugMsg, "ignoring --pointercheck (unimplemented)=
");
- return True;
-}
-
-/*------------------------------------------------------------*/
/*--- Debugger-related operations ---*/
/*------------------------------------------------------------*/
=20
Modified: trunk/coregrind/core.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/core.h 2005-06-01 03:09:59 UTC (rev 3833)
+++ trunk/coregrind/core.h 2005-06-01 03:48:33 UTC (rev 3834)
@@ -278,9 +278,6 @@
// handle an arch-specific client request
extern Bool VGA_(client_request)(ThreadId tid, UWord *args);
=20
-// Pointercheck
-extern Bool VGA_(setup_pointercheck) ( Addr client_base, Addr client_end=
);
-
// For attaching the debugger
extern Int VGA_(ptrace_setregs_from_tst) ( Int pid, ThreadArchState* ar=
ch );
=20
Modified: trunk/coregrind/m_aspacemgr/aspacemgr.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_aspacemgr/aspacemgr.c 2005-06-01 03:09:59 UTC (rev =
3833)
+++ trunk/coregrind/m_aspacemgr/aspacemgr.c 2005-06-01 03:48:33 UTC (rev =
3834)
@@ -1330,6 +1330,46 @@
VG_(exit)(1);
}
=20
+/*------------------------------------------------------------*/
+/*--- pointercheck ---*/
+/*------------------------------------------------------------*/
+
+Bool VGA_(setup_pointercheck)(Addr client_base, Addr client_end)
+{
+ vg_assert(0 !=3D client_end);
+#if defined(VGP_x86_linux)
+ /* Client address space segment limit descriptor entry */
+ #define POINTERCHECK_SEGIDX 1
+
+ vki_modify_ldt_t ldt =3D {=20
+ POINTERCHECK_SEGIDX, // entry_number
+ client_base, // base_addr
+ (client_end - client_base) / VKI_PAGE_SIZE, // limit
+ 1, // seg_32bit
+ 0, // contents: data, RW, non-expanding
+ 0, // ! read_exec_only
+ 1, // limit_in_pages
+ 0, // ! seg not present
+ 1, // useable
+ };
+ int ret =3D VG_(do_syscall3)(__NR_modify_ldt, 1, (UWord)&ldt, sizeof(=
ldt));
+ if (ret < 0) {
+ VG_(message)(Vg_UserMsg,
+ "Warning: ignoring --pointercheck=3Dyes, "
+ "because modify_ldt failed (errno=3D%d)", -ret);
+ return False;
+ } else {
+ return True;
+ }
+#elif defined(VGP_amd64_linux)
+ if (0)=20
+ VG_(message)(Vg_DebugMsg, "ignoring --pointercheck (unimplemented)=
");
+ return True;
+#else
+# error Unknown architecture
+#endif
+}
+
/*--------------------------------------------------------------------*/
/*--- end aspacemgr.c ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_aspacemgr.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_aspacemgr.h 2005-06-01 03:09:59 UTC (rev 383=
3)
+++ trunk/coregrind/pub_core_aspacemgr.h 2005-06-01 03:48:33 UTC (rev 383=
4)
@@ -153,6 +153,9 @@
UInt dev, UInt ino, ULong foff,
const UChar *filename ) );
=20
+// Pointercheck
+extern Bool VGA_(setup_pointercheck) ( Addr client_base, Addr client_end=
);
+
#endif // __PUB_CORE_ASPACEMGR_H
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/x86/state.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/x86/state.c 2005-06-01 03:09:59 UTC (rev 3833)
+++ trunk/coregrind/x86/state.c 2005-06-01 03:48:33 UTC (rev 3834)
@@ -152,38 +152,6 @@
=20
=20
/*------------------------------------------------------------*/
-/*--- pointercheck ---*/
-/*------------------------------------------------------------*/
-
-/* Client address space segment limit descriptor entry */
-#define POINTERCHECK_SEGIDX 1
-
-Bool VGA_(setup_pointercheck)(Addr client_base, Addr client_end)
-{
- vg_assert(0 !=3D client_end);
- vki_modify_ldt_t ldt =3D {=20
- POINTERCHECK_SEGIDX, // entry_number
- client_base, // base_addr
- (client_end - client_base) / VKI_PAGE_SIZE, // limit
- 1, // seg_32bit
- 0, // contents: data, RW, non-expanding
- 0, // ! read_exec_only
- 1, // limit_in_pages
- 0, // ! seg not present
- 1, // useable
- };
- int ret =3D VG_(do_syscall3)(__NR_modify_ldt, 1, (UWord)&ldt, sizeof(=
ldt));
- if (ret < 0) {
- VG_(message)(Vg_UserMsg,
- "Warning: ignoring --pointercheck=3Dyes, "
- "because modify_ldt failed (errno=3D%d)", -ret);
- return False;
- } else {
- return True;
- }
-}
-
-/*------------------------------------------------------------*/
/*--- Debugger-related operations ---*/
/*------------------------------------------------------------*/
=20
|
Author: njn
Date: 2005-06-01 04:09:59 +0100 (Wed, 01 Jun 2005)
New Revision: 3833
Added:
trunk/coregrind/m_profile.c
trunk/coregrind/pub_core_profile.h
trunk/include/pub_tool_profile.h
Removed:
trunk/coregrind/vg_dummy_profile.c
trunk/include/vg_profile.c
Modified:
trunk/addrcheck/ac_main.c
trunk/cachegrind/cg_main.c
trunk/coregrind/Makefile.am
trunk/coregrind/core.h
trunk/coregrind/m_debuginfo/symtab.c
trunk/coregrind/m_demangle/demangle.c
trunk/coregrind/m_execontext.c
trunk/coregrind/m_main.c
trunk/coregrind/m_mallocfree.c
trunk/coregrind/m_scheduler/scheduler.c
trunk/coregrind/m_stacktrace.c
trunk/coregrind/m_syscalls/syscalls.c
trunk/coregrind/m_translate.c
trunk/helgrind/hg_main.c
trunk/include/Makefile.am
trunk/include/tool.h
trunk/massif/ms_main.c
trunk/memcheck/mac_shared.h
Log:
Modularised the profiling stuff as m_profile.c. It's much more=20
sensible now -- no vg_dummy_profile.c, no silly #including of
vg_profile.c from tools. =20
Unfortunately, it still doesn't work, due to bad interactions
with signal handling that I don't understand.
Modified: trunk/addrcheck/ac_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/addrcheck/ac_main.c 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/addrcheck/ac_main.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -32,7 +32,6 @@
=20
#include "mac_shared.h"
#include "memcheck.h"
-//#include "vg_profile.c"
=20
=20
/*------------------------------------------------------------*/
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-01 00:03:17 UTC (rev 3832)
+++ trunk/cachegrind/cg_main.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -34,6 +34,7 @@
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
+#include "pub_tool_profile.h"
#include "pub_tool_tooliface.h"
=20
#include "cg_arch.h"
Modified: trunk/coregrind/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/coregrind/Makefile.am 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/coregrind/Makefile.am 2005-06-01 03:09:59 UTC (rev 3833)
@@ -49,6 +49,7 @@
pub_core_main.h \
pub_core_mallocfree.h \
pub_core_options.h \
+ pub_core_profile.h \
pub_core_redir.h \
pub_core_replacemalloc.h\
pub_core_scheduler.h \
@@ -89,6 +90,7 @@
m_main.c \
m_mallocfree.c \
m_options.c \
+ m_profile.c \
m_redir.c \
m_signals.c \
m_skiplist.c \
@@ -100,7 +102,6 @@
ume.c \
vg_messages.c \
vg_mylibc.c \
- vg_dummy_profile.c \
vg_threadmodel.c \
vg_pthreadmodel.c
=20
Modified: trunk/coregrind/core.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/core.h 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/coregrind/core.h 2005-06-01 03:09:59 UTC (rev 3833)
@@ -88,19 +88,6 @@
extern Int VG_(fd_hard_limit);
=20
/* ---------------------------------------------------------------------
- Profiling stuff
- ------------------------------------------------------------------ */
-
-extern void VG_(init_profiling) ( void );
-extern void VG_(done_profiling) ( void );
-
-#undef VGP_PUSHCC
-#undef VGP_POPCC
-#define VGP_PUSHCC(x) if (VG_(clo_profile)) VG_(pushcc)(x)
-#define VGP_POPCC(x) if (VG_(clo_profile)) VG_(popcc)(x)
-
-
-/* ---------------------------------------------------------------------
Exports of vg_intercept.c
------------------------------------------------------------------ */
=20
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-01 00:03:17 UTC (rev 383=
2)
+++ trunk/coregrind/m_debuginfo/symtab.c 2005-06-01 03:09:59 UTC (rev 383=
3)
@@ -33,6 +33,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_demangle.h"
#include "pub_core_options.h"
+#include "pub_core_profile.h"
#include "pub_core_redir.h"
#include "pub_core_tooliface.h"
#include "priv_symtab.h"
Modified: trunk/coregrind/m_demangle/demangle.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_demangle/demangle.c 2005-06-01 00:03:17 UTC (rev 38=
32)
+++ trunk/coregrind/m_demangle/demangle.c 2005-06-01 03:09:59 UTC (rev 38=
33)
@@ -31,6 +31,7 @@
#include "core.h"
#include "pub_core_demangle.h"
#include "pub_core_options.h"
+#include "pub_core_profile.h"
#include "demangle.h"
=20
void VG_(demangle) ( Char* orig, Char* result, Int result_size )
Modified: trunk/coregrind/m_execontext.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_execontext.c 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/coregrind/m_execontext.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -31,6 +31,7 @@
#include "core.h"
#include "pub_core_execontext.h"
#include "pub_core_options.h"
+#include "pub_core_profile.h"
=20
/*------------------------------------------------------------*/
/*--- Low-level ExeContext storage. ---*/
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-01 00:03:17 UTC (rev 3832)
+++ trunk/coregrind/m_main.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -38,6 +38,7 @@
#include "pub_core_execontext.h"
#include "pub_core_main.h"
#include "pub_core_options.h"
+#include "pub_core_profile.h"
#include "pub_core_redir.h"
#include "pub_core_signals.h"
#include "pub_core_syscalls.h"
Modified: trunk/coregrind/m_mallocfree.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_mallocfree.c 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/coregrind/m_mallocfree.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -33,6 +33,7 @@
#include "core.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_options.h"
+#include "pub_core_profile.h"
#include "valgrind.h"
=20
//zz#include "memcheck/memcheck.h"
Copied: trunk/coregrind/m_profile.c (from rev 3830, trunk/include/vg_prof=
ile.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/include/vg_profile.c 2005-05-31 22:15:14 UTC (rev 3830)
+++ trunk/coregrind/m_profile.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -0,0 +1,169 @@
+
+/*--------------------------------------------------------------------*/
+/*--- Profiling machinery. m_profile.c ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward=20
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#include "core.h"
+#include "pub_core_profile.h"
+
+/* get rid of these, if possible */
+#include <signal.h>
+#include <sys/time.h>
+
+
+#define VGP_M_STACK 20
+#define VGP_MAX_CCS 50
+
+/* All zeroed initially because they're static */
+static Int vgp_nticks;
+
+static Int vgp_counts [VGP_MAX_CCS];
+static Int vgp_entries[VGP_MAX_CCS];
+static Char* vgp_names [VGP_MAX_CCS];
+
+static Int vgp_sp;
+static UInt vgp_stack[VGP_M_STACK];
+
+/* These definitions override the panicking ones in vg_profile.c */
+
+void VG_(register_profile_event) ( Int n, Char* name )
+{
+ /* Adjust for negative values */
+ n +=3D VgpUnc;
+ if (n >=3D VGP_MAX_CCS) {
+ VG_(printf)("\nProfile event #%d higher than VGP_MAX_CCS of %d.\n"
+ "If you really need this many profile events, increase=
\n"
+ "VGP_MAX_CCS and recompile Valgrind.\n",
+ n, VGP_MAX_CCS);
+ VG_(tool_panic)("profile event too high");
+ }
+ if (vgp_names[n] !=3D NULL) {
+ VG_(printf)("\nProfile event #%d being registered as '%s'\n"
+ "already registered as '%s'.\n"
+ "Note that tool and core event numbers must not overla=
p.\n",
+ n, name, vgp_names[n]);
+ VG_(tool_panic)("profile event already registered");
+ }
+
+ vgp_names[n] =3D name;
+}
+
+static void tick ( int sigNo )
+{
+ Int cc;
+ vgp_nticks++;
+ cc =3D vgp_stack[vgp_sp];
+ tl_assert(cc >=3D 0 && cc < VGP_MAX_CCS);
+ vgp_counts[ cc ]++;
+}
+
+void VG_(init_profiling) ( void )
+{
+ struct itimerval value;
+ Int ret;
+
+#ifndef VG_DO_PROFILING
+ VG_(printf)("valgrind: you must compile with VG_DO_PROFILING defined=
\n");
+ VG_(printf)(" before using --profile=3Dyes. Aborting.\n");
+ VG_(exit)(1);
+#endif
+
+ /* Register core events... tricky macro definition causes
+ VG_(register_profile_event)() to be called once for each core even=
t
+ in VGP_CORE_LIST. */
+ tl_assert(VgpUnc =3D=3D 0);
+# define VGP_PAIR(n,name) VG_(register_profile_event)(n,name)
+ VGP_CORE_LIST;
+# undef VGP_PAIR
+
+ vgp_sp =3D -1;
+ VG_(pushcc) ( VgpUnc );
+
+ value.it_interval.tv_sec =3D 0;
+ value.it_interval.tv_usec =3D 10 * 1000;
+ value.it_value =3D value.it_interval;
+
+ signal(SIGPROF, tick );
+ ret =3D setitimer(ITIMER_PROF, &value, NULL);
+ if (ret !=3D 0) VG_(core_panic)("vgp_init_profiling");
+}
+
+void VG_(done_profiling) ( void )
+{
+ Int i;
+ VG_(printf)("\nProfiling done, %d ticks\n", vgp_nticks);
+ for (i =3D 0; i < VGP_MAX_CCS; i++)
+ if (NULL !=3D vgp_names[i])
+ VG_(printf)(
+ "%2d: %4d (%3d %%%%) ticks, %10d entries for %s\n",
+ i, vgp_counts[i],=20
+ (Int)(1000.0 * (double)vgp_counts[i] / (double)vgp_nticks),
+ vgp_entries[i], vgp_names[i] );
+}
+
+void VG_(pushcc) ( UInt cc )
+{
+ if (vgp_sp >=3D VGP_M_STACK-1) {=20
+ VG_(printf)(
+ "\nMaximum profile stack depth (%d) reached for event #%d ('%s'=
).\n"
+ "This is probably due to a VG_(pushcc)() without a matching\n"
+ "VG_(popcc)(). Make sure they all match.\n"
+ "Or if you are nesting profiling events very deeply, increase\n=
"
+ "VGP_M_STACK and recompile Valgrind.\n",
+ VGP_M_STACK, cc, vgp_names[cc]);
+ VG_(core_panic)("Profiling stack overflow");
+ }
+ vgp_sp++;
+ vgp_stack[vgp_sp] =3D cc;
+ vgp_entries[ cc ] ++;
+}
+
+void VG_(popcc) ( UInt cc )
+{
+ if (vgp_sp <=3D 0) {
+ VG_(printf)(
+ "\nProfile stack underflow. This is due to a VG_(popcc)() with=
out\n"
+ "a matching VG_(pushcc)(). Make sure they all match.\n");
+ VG_(core_panic)("Profiling stack underflow");
+ }
+ if (vgp_stack[vgp_sp] !=3D cc) {
+ Int i;
+ VG_(printf)("profiling problem:\n");
+ VG_(printf)("popping %s, stack looks like:\n", vgp_names[cc]);
+ for (i =3D vgp_sp; i >=3D 0; i--)
+ VG_(printf)("%2d: %s\n", i, vgp_names[vgp_stack[i]]);
+ VG_(exit)(1);
+ }
+ vgp_sp--;
+}
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
+
+
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-01 00:03:17 UTC (rev =
3832)
+++ trunk/coregrind/m_scheduler/scheduler.c 2005-06-01 03:09:59 UTC (rev =
3833)
@@ -65,6 +65,7 @@
#include "pub_core_errormgr.h"
#include "pub_core_main.h"
#include "pub_core_options.h"
+#include "pub_core_profile.h"
#include "pub_core_replacemalloc.h"
#include "pub_core_scheduler.h"
#include "pub_core_signals.h"
Modified: trunk/coregrind/m_stacktrace.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_stacktrace.c 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/coregrind/m_stacktrace.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -31,6 +31,7 @@
#include "core.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_options.h"
+#include "pub_core_profile.h"
#include "pub_core_stacktrace.h"
=20
/*------------------------------------------------------------*/
Modified: trunk/coregrind/m_syscalls/syscalls.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_syscalls/syscalls.c 2005-06-01 00:03:17 UTC (rev 38=
32)
+++ trunk/coregrind/m_syscalls/syscalls.c 2005-06-01 03:09:59 UTC (rev 38=
33)
@@ -32,6 +32,7 @@
#include "pub_core_debuglog.h"
#include "pub_core_aspacemgr.h"
#include "pub_core_main.h"
+#include "pub_core_profile.h"
#include "pub_core_stacktrace.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
@@ -6071,7 +6072,7 @@
Bool runInLWP =3D False;
Bool syscall_done =3D False; /* we actually ran the syscall */
=20
- VGP_PUSHCC(VgpCoreSysWrap);
+// VGP_PUSHCC(VgpCoreSysWrap);
=20
tst =3D VG_(get_ThreadState)(tid);
=20
@@ -6198,7 +6199,7 @@
/* VG_(post_syscall) should set this */
vg_assert(tst->syscallno =3D=3D -1);
=20
- VGP_POPCC(VgpCoreSysWrap);
+// VGP_POPCC(VgpCoreSysWrap);
}
=20
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/m_translate.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/coregrind/m_translate.c 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/coregrind/m_translate.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -33,6 +33,7 @@
#include "pub_core_aspacemgr.h"
#include "pub_core_main.h" // for VG_(bbs_done)
#include "pub_core_options.h"
+#include "pub_core_profile.h"
#include "pub_core_redir.h"
#include "pub_core_signals.h"
#include "pub_core_tooliface.h"
@@ -468,6 +469,8 @@
verbosity =3D VG_(clo_trace_flags);
}
=20
+ VGP_PUSHCC(VgpVexTime);
+ =20
/* Actually do the translation. */
tl_assert2(VG_(tdict).tool_instrument,
"you forgot to set VgToolInterface function 'tool_instrume=
nt'");
@@ -492,6 +495,8 @@
vg_assert(tmpbuf_used <=3D N_TMPBUF);
vg_assert(tmpbuf_used > 0);
=20
+ VGP_POPCC(VgpVexTime);
+
#undef DECIDE_IF_PRINTING_CODEGEN
=20
/* Copy data at trans_addr into the translation cache. */
Added: trunk/coregrind/pub_core_profile.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_profile.h 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/coregrind/pub_core_profile.h 2005-06-01 03:09:59 UTC (rev 3833)
@@ -0,0 +1,50 @@
+
+/*--------------------------------------------------------------------*/
+/*--- The built-in profiler. pub_core_profile.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_CORE_PROFILE_H
+#define __PUB_CORE_PROFILE_H
+
+//--------------------------------------------------------------------
+// PURPOSE: This module implements Valgrind's internal tick-and-stack-ba=
sed
+// profiler. To use it, define VG_DO_PROFILING and use --profile=3Dyes.
+// Unfortunately, it's currently broken (and has been for some time)
+// because it doesn't interact well with signal handling.
+//--------------------------------------------------------------------
+
+#include "pub_tool_profile.h"
+
+extern void VG_(init_profiling) ( void );
+extern void VG_(done_profiling) ( void );
+
+#endif // __PUB_CORE_PROFILE_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Deleted: trunk/coregrind/vg_dummy_profile.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/vg_dummy_profile.c 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/coregrind/vg_dummy_profile.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -1,71 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Dummy profiling machinery -- overridden by tools when they ---*/
-/*--- want profiling. ---*/
-/*--- vg_dummy_profile.c ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Julian Seward=20
- js...@ac...
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#include "core.h"
-
-static void vgp_die(void)
-{
- VG_(printf)(
- "\nProfiling error:\n"
- " The --profile=3Dyes option was specified, but the tool\n"
- " wasn't built for profiling. #include \"vg_profile.c\"\n"
- " into the tool and rebuild to allow profiling.\n\n");
- VG_(exit)(1);
-}
-
-void VG_(register_profile_event) ( Int n, Char* name )
-{
-}
-
-void VG_(init_profiling) ( void )
-{
- vgp_die();
-}
-
-void VG_(done_profiling) ( void )
-{
- VG_(core_panic)("done_profiling(), but not compiled for profiling??")=
;
-}
-
-void VG_(pushcc) ( UInt cc )
-{
- vgp_die();
-}
-
-void VG_(popcc) ( UInt cc )
-{
- vgp_die();
-}
-
-/*--------------------------------------------------------------------*/
-/*--- end vg_dummy_profile.c ---*/
-/*--------------------------------------------------------------------*/
Modified: trunk/helgrind/hg_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/helgrind/hg_main.c 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/helgrind/hg_main.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -34,6 +34,7 @@
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
+#include "pub_tool_profile.h"
#include "pub_tool_replacemalloc.h"
#include "pub_tool_tooliface.h"
=20
@@ -1613,7 +1614,7 @@
"Warning: set address range state: large range %d",
len);
=20
- VGP_PUSHCC(VgpSARP);
+ //VGP_PUSHCC(VgpSARP);
=20
/* Remove mutexes in recycled memory range from hash */
find_mutex_range(a, a+len, cleanmx);
@@ -1661,7 +1662,7 @@
VG_(tool_panic)("Unexpected Vge_InitStatus");
}
=20
- VGP_POPCC(VgpSARP);
+ //VGP_POPCC(VgpSARP);
}
=20
=20
Modified: trunk/include/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/include/Makefile.am 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/include/Makefile.am 2005-06-01 03:09:59 UTC (rev 3833)
@@ -1,7 +1,4 @@
=20
-EXTRA_DIST =3D \
- vg_profile.c
-
incincdir =3D $(includedir)/valgrind
=20
incinc_HEADERS =3D \
@@ -13,6 +10,7 @@
pub_tool_hashtable.h \
pub_tool_mallocfree.h \
pub_tool_options.h \
+ pub_tool_profile.h \
pub_tool_replacemalloc.h \
pub_tool_skiplist.h \
pub_tool_stacktrace.h \
Added: trunk/include/pub_tool_profile.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_profile.h 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/include/pub_tool_profile.h 2005-06-01 03:09:59 UTC (rev 3833)
@@ -0,0 +1,92 @@
+
+/*--------------------------------------------------------------------*/
+/*--- The built-in profiler. pub_tool_profile.h ---*/
+/*--------------------------------------------------------------------*/
+
+/*
+ This file is part of Valgrind, a dynamic binary instrumentation
+ framework.
+
+ Copyright (C) 2000-2005 Julian Seward
+ js...@ac...
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307, USA.
+
+ The GNU General Public License is contained in the file COPYING.
+*/
+
+#ifndef __PUB_TOOL_PROFILE_H
+#define __PUB_TOOL_PROFILE_H
+
+// Define this to turn on profiling.
+//#define VG_DO_PROFILING 1
+
+/* Override the empty definitions from tool.h */
+#ifdef VG_DO_PROFILING
+# define VGP_PUSHCC(x) if (VG_(clo_profile)) VG_(pushcc)(x)
+# define VGP_POPCC(x) if (VG_(clo_profile)) VG_(popcc)(x)
+#else
+# define VGP_PUSHCC(x)
+# define VGP_POPCC(x)
+#endif
+
+/* Nb: VG_(register_profile_event)() relies on VgpUnc being the first on=
e */
+#define VGP_CORE_LIST \
+ /* These ones depend on the core */ \
+ VGP_PAIR(VgpUnc, "unclassified"), \
+ VGP_PAIR(VgpStartup, "startup"), \
+ VGP_PAIR(VgpRun, "running"), \
+ VGP_PAIR(VgpSched, "scheduler"), \
+ VGP_PAIR(VgpMalloc, "low-lev malloc/free"), \
+ VGP_PAIR(VgpCliMalloc, "client malloc/free"), \
+ VGP_PAIR(VgpTranslate, "translate-main"), \
+ VGP_PAIR(VgpVexTime, "Vex-time"), \
+ VGP_PAIR(VgpImprove, "improve"), \
+ VGP_PAIR(VgpESPUpdate, "ESP-update"), \
+ VGP_PAIR(VgpSlowFindT, "slow-search-transtab"), \
+ VGP_PAIR(VgpExeContext, "exe-context"), \
+ VGP_PAIR(VgpReadSyms, "read-syms"), \
+ VGP_PAIR(VgpSearchSyms, "search-syms"), \
+ VGP_PAIR(VgpAddToT, "add-to-transtab"), \
+ VGP_PAIR(VgpCoreSysWrap, "core-syscall-wrapper"), \
+ VGP_PAIR(VgpDemangle, "demangle"), \
+ VGP_PAIR(VgpCoreCheapSanity, "core-cheap-sanity"), \
+ VGP_PAIR(VgpCoreExpensiveSanity, "core-expensive-sanity"), \
+ /* These ones depend on the tool */ \
+ VGP_PAIR(VgpPreCloInit, "pre-clo-init"), \
+ VGP_PAIR(VgpPostCloInit, "post-clo-init"), \
+ VGP_PAIR(VgpInstrument, "instrument"), \
+ VGP_PAIR(VgpToolSysWrap, "tool-syscall-wrapper"), \
+ VGP_PAIR(VgpToolCheapSanity, "tool-cheap-sanity"), \
+ VGP_PAIR(VgpToolExpensiveSanity, "tool-expensive-sanity"), \
+ VGP_PAIR(VgpFini, "fini")
+
+#define VGP_PAIR(n,name) n
+typedef enum { VGP_CORE_LIST } VgpCoreCC;
+#undef VGP_PAIR
+
+/* When registering tool profiling events, ensure that the 'n' value is =
in
+ * the range (VgpFini+1..) */
+extern void VG_(register_profile_event) ( Int n, Char* name );
+
+extern void VG_(pushcc) ( UInt cc );
+extern void VG_(popcc) ( UInt cc );
+
+#endif // __PUB_TOOL_PROFILE_H
+
+/*--------------------------------------------------------------------*/
+/*--- end ---*/
+/*--------------------------------------------------------------------*/
Modified: trunk/include/tool.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/tool.h 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/include/tool.h 2005-06-01 03:09:59 UTC (rev 3833)
@@ -97,65 +97,6 @@
=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 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*/
-
-/* Nb: VG_(register_profile_event)() relies on VgpUnc being the first on=
e */
-#define VGP_CORE_LIST \
- /* These ones depend on the core */ \
- VGP_PAIR(VgpUnc, "unclassified"), \
- VGP_PAIR(VgpStartup, "startup"), \
- VGP_PAIR(VgpRun, "running"), \
- VGP_PAIR(VgpSched, "scheduler"), \
- VGP_PAIR(VgpMalloc, "low-lev malloc/free"), \
- VGP_PAIR(VgpCliMalloc, "client malloc/free"), \
- VGP_PAIR(VgpTranslate, "translate-main"), \
- VGP_PAIR(VgpToUCode, "to-ucode"), \
- VGP_PAIR(VgpFromUcode, "from-ucode"), \
- VGP_PAIR(VgpImprove, "improve"), \
- VGP_PAIR(VgpESPUpdate, "ESP-update"), \
- VGP_PAIR(VgpRegAlloc, "reg-alloc"), \
- VGP_PAIR(VgpLiveness, "liveness-analysis"), \
- VGP_PAIR(VgpDoLRU, "do-lru"), \
- VGP_PAIR(VgpSlowFindT, "slow-search-transtab"), \
- VGP_PAIR(VgpExeContext, "exe-context"), \
- VGP_PAIR(VgpReadSyms, "read-syms"), \
- VGP_PAIR(VgpSearchSyms, "search-syms"), \
- VGP_PAIR(VgpAddToT, "add-to-transtab"), \
- VGP_PAIR(VgpCoreSysWrap, "core-syscall-wrapper"), \
- VGP_PAIR(VgpDemangle, "demangle"), \
- VGP_PAIR(VgpCoreCheapSanity, "core-cheap-sanity"), \
- VGP_PAIR(VgpCoreExpensiveSanity, "core-expensive-sanity"), \
- /* These ones depend on the tool */ \
- VGP_PAIR(VgpPreCloInit, "pre-clo-init"), \
- VGP_PAIR(VgpPostCloInit, "post-clo-init"), \
- VGP_PAIR(VgpInstrument, "instrument"), \
- VGP_PAIR(VgpToolSysWrap, "tool-syscall-wrapper"), \
- VGP_PAIR(VgpToolCheapSanity, "tool-cheap-sanity"), \
- VGP_PAIR(VgpToolExpensiveSanity, "tool-expensive-sanity"), \
- VGP_PAIR(VgpFini, "fini")
-
-#define VGP_PAIR(n,name) n
-typedef enum { VGP_CORE_LIST } VgpCoreCC;
-#undef VGP_PAIR
-
-/* When registering tool profiling events, ensure that the 'n' value is =
in
- * the range (VgpFini+1..) */
-extern void VG_(register_profile_event) ( Int n, Char* name );
-
-extern void VG_(pushcc) ( UInt cc );
-extern void VG_(popcc) ( UInt cc );
-
-/* Define them only if they haven't already been defined by vg_profile.c=
*/
-#ifndef VGP_PUSHCC
-# define VGP_PUSHCC(x)
-#endif
-#ifndef VGP_POPCC
-# define VGP_POPCC(x)
-#endif
-
-
-/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D*/
/*=3D=3D=3D Useful stuff to call from generated code =
=3D=3D=3D*/
/*=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=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
Deleted: trunk/include/vg_profile.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/include/vg_profile.c 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/include/vg_profile.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -1,173 +0,0 @@
-
-/*--------------------------------------------------------------------*/
-/*--- Profiling machinery. #include this file into a tool to ---*/
-/*--- enable --profile=3Dyes, but not for release versions of tools, ---=
*/
-/*--- because it uses glibc code. ---*/
-/*--- vg_profile.c ---*/
-/*--------------------------------------------------------------------*/
-
-/*
- This file is part of Valgrind, a dynamic binary instrumentation
- framework.
-
- Copyright (C) 2000-2005 Julian Seward=20
- js...@ac...
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307, USA.
-
- The GNU General Public License is contained in the file COPYING.
-*/
-
-#ifndef __VG_PROFILE_C
-#define __VG_PROFILE_C
-
-#include "tool.h"
-
-/* get rid of these, if possible */
-#include <signal.h>
-#include <sys/time.h>
-
-/* Override the empty definitions from tool.h */
-#undef VGP_PUSHCC
-#undef VGP_POPCC
-#define VGP_PUSHCC(x) if (VG_(clo_profile)) VG_(pushcc)(x)
-#define VGP_POPCC(x) if (VG_(clo_profile)) VG_(popcc)(x)
-
-#define VGP_M_STACK 20
-#define VGP_MAX_CCS 50
-
-
-/* All zeroed initially because they're static */
-static Int vgp_nticks;
-
-static Int vgp_counts [VGP_MAX_CCS];
-static Int vgp_entries[VGP_MAX_CCS];
-static Char* vgp_names [VGP_MAX_CCS];
-
-static Int vgp_sp;
-static UInt vgp_stack[VGP_M_STACK];
-
-/* These definitions override the panicking ones in vg_profile.c */
-
-void VG_(register_profile_event) ( Int n, Char* name )
-{
- /* Adjust for negative values */
- n +=3D VgpUnc;
- if (n >=3D VGP_MAX_CCS) {
- VG_(printf)("\nProfile event #%d higher than VGP_MAX_CCS of %d.\n"
- "If you really need this many profile events, increase=
\n"
- "VGP_MAX_CCS and recompile Valgrind.\n",
- n, VGP_MAX_CCS);
- VG_(tool_panic)("profile event too high");
- }
- if (vgp_names[n] !=3D NULL) {
- VG_(printf)("\nProfile event #%d being registered as '%s'\n"
- "already registered as '%s'.\n"
- "Note that tool and core event numbers must not overla=
p.\n",
- n, name, vgp_names[n]);
- VG_(tool_panic)("profile event already registered");
- }
-
- vgp_names[n] =3D name;
-}
-
-void VG_(tick) ( int sigNo )
-{
- Int cc;
- vgp_nticks++;
- cc =3D vgp_stack[vgp_sp];
- tl_assert(cc >=3D 0 && cc < VGP_MAX_CCS);
- vgp_counts[ cc ]++;
-}
-
-void VG_(init_profiling) ( void )
-{
- struct itimerval value;
- Int ret;
-
- /* Register core events... tricky macro definition causes
- VG_(register_profile_event)() to be called once for each core even=
t
- in VGP_CORE_LIST. */
- tl_assert(VgpUnc =3D=3D 0);
-# define VGP_PAIR(n,name) VG_(register_profile_event)(n,name)
- VGP_CORE_LIST;
-# undef VGP_PAIR
-
- vgp_sp =3D -1;
- VG_(pushcc) ( VgpUnc );
-
- value.it_interval.tv_sec =3D 0;
- value.it_interval.tv_usec =3D 10 * 1000;
- value.it_value =3D value.it_interval;
-
- signal(SIGPROF, VG_(tick) );
- ret =3D setitimer(ITIMER_PROF, &value, NULL);
- if (ret !=3D 0) VG_(tool_panic)("vgp_init_profiling");
-}
-
-void VG_(done_profiling) ( void )
-{
- Int i;
- VG_(printf)("\nProfiling done, %d ticks\n", vgp_nticks);
- for (i =3D 0; i < VGP_MAX_CCS; i++)
- if (NULL !=3D vgp_names[i])
- VG_(printf)(
- "%2d: %4d (%3d %%%%) ticks, %10d entries for %s\n",
- i, vgp_counts[i],=20
- (Int)(1000.0 * (double)vgp_counts[i] / (double)vgp_nticks),
- vgp_entries[i], vgp_names[i] );
-}
-
-void VG_(pushcc) ( UInt cc )
-{
- if (vgp_sp >=3D VGP_M_STACK-1) {=20
- VG_(printf)(
- "\nMaximum profile stack depth (%d) reached for event #%d ('%s'=
).\n"
- "This is probably due to a VG_(pushcc)() without a matching\n"
- "VG_(popcc)(). Make sure they all match.\n"
- "Or if you are nesting profiling events very deeply, increase\n=
"
- "VGP_M_STACK and recompile Valgrind.\n",
- VGP_M_STACK, cc, vgp_names[cc]);
- VG_(tool_panic)("Profiling stack overflow");
- }
- vgp_sp++;
- vgp_stack[vgp_sp] =3D cc;
- vgp_entries[ cc ] ++;
-}
-
-void VG_(popcc) ( UInt cc )
-{
- if (vgp_sp <=3D 0) {
- VG_(printf)(
- "\nProfile stack underflow. This is due to a VG_(popcc)() with=
out\n"
- "a matching VG_(pushcc)(). Make sure they all match.\n");
- VG_(tool_panic)("Profiling stack underflow");
- }
- if (vgp_stack[vgp_sp] !=3D cc) {
- Int i;
- VG_(printf)("popping %s, stack looks like:\n", vgp_names[cc]);
- for (i =3D vgp_sp; i >=3D 0; i--)
- VG_(printf)("%2d: %s\n", i, vgp_names[vgp_stack[i]]);
- VG_(exit)(1);
- }
- vgp_sp--;
-}
-
-#endif /* __VG_PROFILE_C */
-
-/*--------------------------------------------------------------------*/
-/*--- end vg_profile.c ---*/
-/*--------------------------------------------------------------------*/
Modified: trunk/massif/ms_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/massif/ms_main.c 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/massif/ms_main.c 2005-06-01 03:09:59 UTC (rev 3833)
@@ -39,6 +39,7 @@
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
+#include "pub_tool_profile.h"
#include "pub_tool_replacemalloc.h"
#include "pub_tool_stacktrace.h"
#include "pub_tool_tooliface.h"
Modified: trunk/memcheck/mac_shared.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/mac_shared.h 2005-06-01 00:03:17 UTC (rev 3832)
+++ trunk/memcheck/mac_shared.h 2005-06-01 03:09:59 UTC (rev 3833)
@@ -40,6 +40,7 @@
#include "pub_tool_hashtable.h"
#include "pub_tool_mallocfree.h"
#include "pub_tool_options.h"
+#include "pub_tool_profile.h"
#include "pub_tool_replacemalloc.h"
#include "pub_tool_tooliface.h"
=20
|
|
From: <js...@ac...> - 2005-06-01 02:50:04
|
Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-01 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow Nightly build on phoenix ( SuSE 9.1 ) started at 2005-06-01 03:50:00 BST |
|
From: Tom H. <to...@co...> - 2005-06-01 02:35:59
|
Nightly build on dunsmere ( athlon, Fedora Core 3 ) started at 2005-06-01 03:30: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, 6 stderr failures, 1 stdout failure ================= memcheck/tests/x86/scalar (stderr) memcheck/tests/x86/scalar_supp (stderr) memcheck/tests/xml1 (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-01 02:30:34
|
Nightly build on audi ( i686, Red Hat 9 ) started at 2005-06-01 03:25:02 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, 19 stderr failures, 13 stdout failures ================= memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/pth_atfork1 (stdout) corecheck/tests/pth_atfork1 (stderr) corecheck/tests/pth_cancel1 (stdout) corecheck/tests/pth_cancel1 (stderr) corecheck/tests/pth_cancel2 (stderr) corecheck/tests/pth_cvsimple (stdout) corecheck/tests/pth_cvsimple (stderr) corecheck/tests/pth_exit (stderr) corecheck/tests/pth_once (stdout) corecheck/tests/pth_once (stderr) corecheck/tests/res_search (stdout) corecheck/tests/res_search (stderr) corecheck/tests/threadederrno (stdout) corecheck/tests/threadederrno (stderr) none/tests/faultstatus (stderr) none/tests/manythreads (stdout) none/tests/manythreads (stderr) none/tests/pth_blockedsig (stdout) none/tests/pth_blockedsig (stderr) none/tests/pth_stackalign (stdout) none/tests/pth_stackalign (stderr) none/tests/thread-exits (stdout) none/tests/thread-exits (stderr) none/tests/threaded-fork (stdout) none/tests/threaded-fork (stderr) none/tests/tls (stdout) none/tests/tls (stderr) none/tests/x86/int (stderr) none/tests/yield (stdout) none/tests/yield (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-01 02:25:27
|
Nightly build on ginetta ( i686, Red Hat 8.0 ) started at 2005-06-01 03:20: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 == 174 tests, 4 stderr failures, 0 stdout failures ================= memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-01 02:20:36
|
Nightly build on alvis ( i686, Red Hat 7.3 ) started at 2005-06-01 03:15:02 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 == 174 tests, 13 stderr failures, 1 stdout failure ================= memcheck/tests/addressable (stderr) memcheck/tests/describe-block (stderr) memcheck/tests/leak-0 (stderr) memcheck/tests/leak-cycle (stderr) memcheck/tests/leak-regroot (stderr) memcheck/tests/leak-tree (stderr) memcheck/tests/match-overrun (stderr) memcheck/tests/pointer-trace (stderr) memcheck/tests/vgtest_ume (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) none/tests/faultstatus (stderr) none/tests/x86/int (stderr) none/tests/yield (stdout) |
|
From: Tom H. <th...@cy...> - 2005-06-01 02:19:39
|
Nightly build on dellow ( x86_64, Fedora Core 3 ) started at 2005-06-01 03:10: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 == 155 tests, 15 stderr failures, 1 stdout failure ================= memcheck/tests/brk (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) |
|
From: Tom H. <th...@cy...> - 2005-06-01 02:05:10
|
Nightly build on gill ( x86_64, Fedora Core 2 ) started at 2005-06-01 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 == 155 tests, 16 stderr failures, 1 stdout failure ================= memcheck/tests/brk (stderr) memcheck/tests/sigaltstack (stderr) memcheck/tests/sigprocmask (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/weirdioctl (stderr) memcheck/tests/xml1 (stderr) corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_dup (stderr) corecheck/tests/fdleak_dup2 (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_pipe (stderr) corecheck/tests/fdleak_socketpair (stderr) massif/tests/toobig-allocs (stderr) none/tests/faultstatus (stderr) none/tests/selfrun (stdout) none/tests/selfrun (stderr) |
|
From: <sv...@va...> - 2005-06-01 00:03:21
|
Author: njn
Date: 2005-06-01 01:03:17 +0100 (Wed, 01 Jun 2005)
New Revision: 3832
Modified:
trunk/coregrind/core.h
trunk/coregrind/m_signals.c
trunk/coregrind/pub_core_execontext.h
trunk/coregrind/vg_mylibc.c
Log:
Whitespace/comment-only changes, to serve as placeholder for the last com=
mit
which I put the wrong log message in for. The log message should have be=
en:
Clean up VG_(core_panic_at)() -- pass it ip/sp/fp rather than a
StackTrace. This allows m_signals.c to not have to know about
m_stacktrace.c, nor does core.h need to import pub_core_stacktrace.h an=
y
more. (Also fixed a bug that was preventing vg_assert2's extra string
from being printed.)
Also moved VG_DEEPEST_BACKTRACE out of core.h into pub_core_execontext.=
h.
Modified: trunk/coregrind/core.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/core.h 2005-06-01 00:00:46 UTC (rev 3831)
+++ trunk/coregrind/core.h 2005-06-01 00:03:17 UTC (rev 3832)
@@ -3,7 +3,7 @@
/*--- A header file for various private parts of Valgrind's core. ---*/
/*--- core.h ---*/
/*--------------------------------------------------------------------*/
-
+=20
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
Modified: trunk/coregrind/m_signals.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_signals.c 2005-06-01 00:00:46 UTC (rev 3831)
+++ trunk/coregrind/m_signals.c 2005-06-01 00:03:17 UTC (rev 3832)
@@ -1,8 +1,8 @@
=20
/*--------------------------------------------------------------------*/
-/*--- Implementation of POSIX signals. vg_signals.c ---*/
+/*--- Implementation of POSIX signals. m_signals.c ---*/
/*--------------------------------------------------------------------*/
-
+=20
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
@@ -2080,5 +2080,5 @@
}
=20
/*--------------------------------------------------------------------*/
-/*--- end vg_signals.c ---*/
+/*--- end ---*/
/*--------------------------------------------------------------------*/
Modified: trunk/coregrind/pub_core_execontext.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_execontext.h 2005-06-01 00:00:46 UTC (rev 38=
31)
+++ trunk/coregrind/pub_core_execontext.h 2005-06-01 00:03:17 UTC (rev 38=
32)
@@ -1,3 +1,4 @@
+
/*--------------------------------------------------------------------*/
/*--- ExeContexts: long-lived, non-dup'd stack traces. ---*/
/*--- pub_core_execontext.h ---*/
Modified: trunk/coregrind/vg_mylibc.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/vg_mylibc.c 2005-06-01 00:00:46 UTC (rev 3831)
+++ trunk/coregrind/vg_mylibc.c 2005-06-01 00:03:17 UTC (rev 3832)
@@ -4,7 +4,7 @@
/*--- on libc.so. ---*/
/*--- vg_mylibc.c ---*/
/*--------------------------------------------------------------------*/
-
+=20
/*
This file is part of Valgrind, a dynamic binary instrumentation
framework.
|
|
From: <sv...@va...> - 2005-06-01 00:00:54
|
Author: njn
Date: 2005-06-01 01:00:46 +0100 (Wed, 01 Jun 2005)
New Revision: 3831
Modified:
trunk/coregrind/core.h
trunk/coregrind/m_signals.c
trunk/coregrind/pub_core_execontext.h
trunk/coregrind/vg_mylibc.c
Log:
Modularised vg_signals.c as m_signals.c.
Modified: trunk/coregrind/core.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/core.h 2005-05-31 22:15:14 UTC (rev 3830)
+++ trunk/coregrind/core.h 2005-06-01 00:00:46 UTC (rev 3831)
@@ -41,7 +41,6 @@
=20
#include "pub_core_mallocfree.h" // for type 'ArenaId'
#include "pub_core_scheduler.h" // for types 'ThreadState', 'ThreadArc=
hState'
-#include "pub_core_stacktrace.h" // for type 'StackTrace'
=20
/* ---------------------------------------------------------------------
Global macros.
@@ -50,10 +49,6 @@
/* Max length of a text fragment used to construct error messages. */
#define VG_ERRTXT_LEN 4096
=20
-/* The maximum number of calls we're prepared to save in a
- backtrace. */
-#define VG_DEEPEST_BACKTRACE 50
-
/* Useful macros */
/* a - alignment - must be a power of 2 */
#define ROUNDDN(p, a) ((Addr)(p) & ~((Addr)(a)-1))
@@ -166,7 +161,7 @@
__attribute__ ((__noreturn__))
extern void VG_(core_panic) ( Char* str );
__attribute__ ((__noreturn__))
-extern void VG_(core_panic_at) ( Char* str, StackTrace ips );
+extern void VG_(core_panic_at) ( Char* str, Addr ip, Addr sp, Addr fp=
);
=20
/* Called when some unhandleable client behaviour is detected.
Prints a msg and aborts. */
Modified: trunk/coregrind/m_signals.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_signals.c 2005-05-31 22:15:14 UTC (rev 3830)
+++ trunk/coregrind/m_signals.c 2005-06-01 00:00:46 UTC (rev 3831)
@@ -87,6 +87,7 @@
#include "pub_core_options.h"
#include "pub_core_signals.h"
#include "pub_core_sigframe.h"
+#include "pub_core_stacktrace.h"
#include "pub_core_syscalls.h"
#include "pub_core_tooliface.h"
=20
@@ -1845,7 +1846,6 @@
from the client's code, then we can jump back into the scheduler
and have it delivered. Otherwise it's a Valgrind bug. */
{ =20
- Addr ips[ VG_(clo_backtrace_size) ];
ThreadState *tst =3D VG_(get_ThreadState)(VG_(get_lwp_tid)(VG_(get=
tid)()));
=20
if (VG_(sigismember)(&tst->sig_mask, sigNo)) {
@@ -1889,15 +1889,10 @@
// tid =3D VG_(master_tid);
vg_assert(tid !=3D 0);
=20
- tst =3D VG_(get_ThreadState)(tid);
- VG_(get_StackTrace2)(ips, VG_(clo_backtrace_size),=20
- VGP_UCONTEXT_INSTR_PTR(uc),
- VGP_UCONTEXT_STACK_PTR(uc),
- VGP_UCONTEXT_FRAME_PTR(uc),
- VGP_UCONTEXT_STACK_PTR(uc),
- tst->os_state.valgrind_stack_base +=20
- tst->os_state.valgrind_stack_szB);
- VG_(core_panic_at)("Killed by fatal signal", ips);
+ VG_(core_panic_at)("Killed by fatal signal",
+ VGP_UCONTEXT_INSTR_PTR(uc),
+ VGP_UCONTEXT_STACK_PTR(uc),
+ VGP_UCONTEXT_FRAME_PTR(uc));
}
}
=20
Modified: trunk/coregrind/pub_core_execontext.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_execontext.h 2005-05-31 22:15:14 UTC (rev 38=
30)
+++ trunk/coregrind/pub_core_execontext.h 2005-06-01 00:00:46 UTC (rev 38=
31)
@@ -41,6 +41,9 @@
=20
#include "pub_core_stacktrace.h"
=20
+/* The maximum number of calls we're prepared to save in an ExeContext. =
*/
+#define VG_DEEPEST_BACKTRACE 50
+
// Print stats (informational only).
extern void VG_(print_ExeContext_stats) ( void );
=20
Modified: trunk/coregrind/vg_mylibc.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/vg_mylibc.c 2005-05-31 22:15:14 UTC (rev 3830)
+++ trunk/coregrind/vg_mylibc.c 2005-06-01 00:00:46 UTC (rev 3831)
@@ -941,39 +941,29 @@
# error Unknown platform
#endif
=20
-
-/* Fake up an ExeContext which is of our actual real CPU state, so we
- can print a stack trace. This isn't terribly useful in the case
- where we were killed by a signal, since we just get a backtrace
- into the signal handler. Also, it could be somewhat risky if we
- actully got the panic/exception within the execontext/stack
- dump/symtab code. But it's better than nothing. */
-static inline void get_and_pp_real_StackTrace(Addr ret)
+__attribute__ ((noreturn))
+static void report_and_quit ( const Char* report, Addr ip, Addr sp, Addr=
fp )
{
- Addr ips[VG_DEEPEST_BACKTRACE];
- Addr sp, fp;
- Addr stacktop;
- ThreadId tid =3D VG_(get_lwp_tid)(VG_(gettid)());
- ThreadState *tst =3D VG_(get_ThreadState)(tid);
+ #define BACKTRACE_DEPTH 100 // nice and deep!
+ Addr stacktop, ips[BACKTRACE_DEPTH];
+ ThreadState *tst;
=20
- GET_REAL_SP_AND_FP(sp, fp);
+ tst =3D VG_(get_ThreadState)( VG_(get_lwp_tid)(VG_(gettid)()) );
=20
+ // If necessary, fake up an ExeContext which is of our actual real CP=
U
+ // state. Could cause problems if we got the panic/exception within =
the
+ // execontext/stack dump/symtab code. But it's better than nothing.
+ if (0 =3D=3D ip && 0 =3D=3D sp && 0 =3D=3D fp) {
+ ip =3D (Addr)__builtin_return_address(0);
+ GET_REAL_SP_AND_FP(sp, fp);
+ }
+
stacktop =3D tst->os_state.valgrind_stack_base +=20
tst->os_state.valgrind_stack_szB;
=20
- VG_(get_StackTrace2)(ips, VG_(clo_backtrace_size),
- ret, sp, fp, sp, stacktop);
- VG_(pp_StackTrace) (ips, VG_(clo_backtrace_size));
-}
+ VG_(get_StackTrace2)(ips, BACKTRACE_DEPTH, ip, sp, fp, sp, stacktop);
+ VG_(pp_StackTrace) (ips, BACKTRACE_DEPTH);
=20
-__attribute__ ((noreturn))
-static void report_and_quit ( const Char* report, StackTrace ips )
-{
- if (ips =3D=3D NULL)
- get_and_pp_real_StackTrace((Addr)__builtin_return_address(0));
- else
- VG_(pp_StackTrace)(ips, VG_(clo_backtrace_size));
- =20
VG_(printf)("\nBasic block ctr is approximately %llu\n", VG_(bbs_done=
) );
=20
VG_(pp_sched_status)();
@@ -986,6 +976,8 @@
VG_(printf)("In the bug report, send all the above text, the valgrind=
\n");
VG_(printf)("version, and what Linux distro you are using. Thanks.\n=
\n");
VG_(exit)(1);
+
+ #undef BACKTRACE_DEPTH
}
=20
void VG_(assert_fail) ( Bool isCore, const Char* expr, const Char* file,=
=20
@@ -1002,9 +994,8 @@
VG_(exit)(2);
entered =3D True;
=20
- va_start(vargs,format);
+ va_start(vargs, format);
VG_(vsprintf) ( bufptr, format, vargs );
- add_to_vg_sprintf_buf('\0', &bufptr);
va_end(vargs);
=20
if (isCore) {
@@ -1026,29 +1017,30 @@
if (!VG_STREQ(buf, ""))
VG_(printf)("%s: %s\n", component, buf );
=20
- report_and_quit(bugs_to, NULL);
+ report_and_quit(bugs_to, 0,0,0);
}
=20
__attribute__ ((noreturn))
-static void panic ( Char* name, Char* report, Char* str, StackTrace ips =
)
+static void panic ( Char* name, Char* report, Char* str,
+ Addr ip, Addr sp, Addr fp )
{
VG_(printf)("\n%s: the 'impossible' happened:\n %s\n", name, str);
- report_and_quit(report, ips);
+ report_and_quit(report, ip, sp, fp);
}
=20
-void VG_(core_panic) ( Char* str )
+void VG_(core_panic_at) ( Char* str, Addr ip, Addr sp, Addr fp )
{
- panic("valgrind", VG_BUGS_TO, str, NULL);
+ panic("valgrind", VG_BUGS_TO, str, ip, sp, fp);
}
=20
-void VG_(core_panic_at) ( Char* str, StackTrace ips )
+void VG_(core_panic) ( Char* str )
{
- panic("valgrind", VG_BUGS_TO, str, ips);
+ VG_(core_panic_at)(str, 0,0,0);
}
=20
void VG_(tool_panic) ( Char* str )
{
- panic(VG_(details).name, VG_(details).bug_reports_to, str, NULL);
+ panic(VG_(details).name, VG_(details).bug_reports_to, str, 0,0,0);
}
=20
/* Print some helpful-ish text about unimplemented things, and give
|