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
(15) |
2
(17) |
3
(23) |
4
(13) |
5
(7) |
6
(8) |
7
(9) |
|
8
(8) |
9
(31) |
10
(31) |
11
(19) |
12
(11) |
13
(38) |
14
(14) |
|
15
(8) |
16
(11) |
17
(7) |
18
(17) |
19
(12) |
20
(12) |
21
(17) |
|
22
(19) |
23
(33) |
24
(42) |
25
(37) |
26
(23) |
27
(27) |
28
(27) |
|
29
(16) |
30
(52) |
31
(33) |
|
|
|
|
|
From: Jeremy F. <je...@go...> - 2004-08-07 22:25:03
|
On Fri, 2004-08-06 at 13:38 +0100, Nicholas Nethercote wrote: > I've been looking at them (and to a lesser extent, their part-time > accomplices vg_libpthread.c and vg_syscalls.c) a bit, in an attempt to > find ways to make them smaller, simpler, and/or less coupled. I haven't > had much luck. A large part of the problem is that this stuff -- threads, > signals and blocking syscalls -- is just really complicated; it's > unavoidable that the code dealing with these aspects is going to be nasty > in places. Yup. Valgrind is in the awkward position of having to track the kernel's model of signals, threads and system calls. This is just all very complex. We've made the job more complex for ourselves by insisting that all the user code runs in a single threads, since that introduces the extra complexity of the proxyLWP stuff. One of my design goals was to use as much of the kernel machinery as possible so we don't have to emulate it - that's what the proxyLWPs are for, but it wasn't as successful as I'd hoped for. If we could work out a way to get all the other behaviours we want, running the app threads in their own kernel threads would probably simplify a lot of this because we could just use the kernel directly, rather than having to emulate it quite so much. > But I still think there must be room for improvement. I've certainly been > able to improve some other areas, but this part defeated me because it's > too big and tangled. For example, my starting point for the allocation > improvements was the call-graph for the involved functions; the > call-graph for the threads/signals/etc stuff was too big and painful to > work out by hand. (BTW, does anyone know any good call-graph drawing > programs? I couldn't find any that worked on my machine.) > > One critical factor is that all these files spend a lot of time fiddling > about with the ThreadState of different threads. ThreadState is a huge, > ugly data structure. Large parts of it are unavoidable -- every thread > must have a stack, an alt-stack, a clean-up stack, TLS, a sigmask, an ldt, > saved reg state, etc -- that's just a consequence of threads being complex > in general. But I wonder if other parts could be removed or simplified in > some way? Or if fewer pieces of code could be made to touch this > structure? Too many pieces of code just jump in and fiddle about with it. Well, they all fiddle with different pieces of it. For notation's sake, it might be worth breaking it into separate sub-structures: scheduler state, pthreads state, syscall/signal state, CPU state. Apart from the pthreads state, I can't see anything which doesn't need to be there. The structure is ~900 bytes, and 512 bytes of that is sse state. > Another factor is that the proxyLWP stuff, while undoubtedly very clever, > duplicates a lot of the code in vg_signals.c and vg_scheduler.c. Well, > not quite duplicates, but does stuff that is annoyingly similar. Perhaps > this situation could be improved? Could you be a bit more specific? > And it's pretty complicated in many > ways too; just look at do_pthread_syscall() and the reason for its > existence. Yuk. I would love to get rid of it, but it's basically a workaround for a bug in the Unix API. There's just no way to atomically unblock some signals and run a syscall. > The current work being done on architecture ports should help clean up and > factor out a lot of the stuff on that front. I'm fairly confident > architecture abstraction can be done cleanly and without disturbing things > too much. Our experience with vg_to_ucode.c and vg_from_ucode.c have > shown that the processor stuff, although reasonably complicated, is > sufficiently self-contained and unchanging that it doesn't cause many > problems. Once it's correct, it tends to stay correct. > > In comparison, I'm not so confident about the OS ports side, because that > stuff has three nasty properties: it's complicated, not neatly contained, > and it does change. Yes, that worries me too. There are some things which we can be reasonably sure will be the same across all Unix-like systems (eg, they'll all have open/read/write/close syscalls), but the whole threads/ signals stuff could be quite different. And some Unix-like systems, like MacOS X, may have large chunks very non-Unix behaviour (all the Mach stuff, in MacOS X's instance). As you say, CPUs are relatively fixed, well defined and well documented, but OSs are not (and operating environments, ie, including the libraries, are really very variable). > This message has a couple of aims: > > - to provoke ideas/discussion about specific improvements to the current > vg_scheduler.c/vg_signals.c/vg_proxylwp.c mess; > > - to provoke more general, long-term ideas/discussion about modularity, > complexity, etc. > > I'm not meaning to criticise anyone or their code. > > I'm not really interested in hearing explanations about why a particular > piece of code works the way it is, eg. "feature X is required because of Y > and Z", unless they somehow feed into the next point... > > I am interested in hearing ideas about how things can be improved, eg. "A > and B have a lot in common, if we factor the commonality out it will cut > 100 lines of code and make C easier to understand", or "I noticed that we > no longer need D since we changed E", or "merging F and G means that we > can convert H from a global function into a local one", or higher-level > things. > > Ideas are welcome; let 'em rip. Well, I think a big obvious first step is to drop all the pthreads support from the core, which will simplify vg_scheduler a fair bit. The scheduler doesn't really need to know much about a thread's state other than its running or blocked on some event (which is probably always syscall completion of some kind). This means that to do threading, all OS ports must do enough to support the native threads library. The downside is that this could result in as much complexity as dropping core ptheads support removes, and it would be duplicated for each OS port. But it does mean that we don't have to carry libpthread around, which is a large and increasing burden (and that's just for all the x86-linux variants). Also, one general comment about the refactoring. It's obviously a good idea, and you've done a really good job so far. But we have to be careful that when things get merged together, that they're actually semantically the same rather than just coincidentally the same. For example, if Linux and BSD happen to have the same shaped, say, signal delivery structure, that doesn't mean we should use the same structure definition and delivery functions for both. Their similarity is just a coincidence, and we don't want to introduce a false coupling between those implementations. J |
|
From: Nicholas N. <nj...@ca...> - 2004-08-07 18:17:03
|
CVS commit by nethercote:
Make VG_(last_run_tid) and VG_(sigstack) local.
M +3 -13 vg_include.h 1.228
M +6 -9 vg_main.c 1.191
M +4 -4 vg_mylibc.c 1.85
M +3 -3 vg_scheduler.c 1.167
M +23 -15 vg_signals.c 1.79
--- valgrind/coregrind/vg_include.h #1.227:1.228
@@ -129,7 +129,4 @@
#define VG_N_SUPP_CALLERS 4
-/* Valgrind's signal stack size, in words */
-#define VG_SIGSTACK_SIZE_W 10000
-
/* Useful macros */
/* a - alignment - must be a power of 2 */
@@ -935,5 +932,6 @@ typedef
/* The scheduler. */
-extern VgSchedReturnCode VG_(scheduler) ( Int* exit_code );
+extern VgSchedReturnCode VG_(scheduler) ( Int* exit_code,
+ ThreadId* last_run_thread );
extern void VG_(scheduler_init) ( void );
@@ -1025,4 +1023,5 @@ extern void VG_(synth_fault_mapping)(Thr
extern void VG_(synth_fault_perms) (ThreadId tid, Addr addr);
+extern void VG_(get_sigstack_bounds)( Addr* low, Addr* high );
/* ---------------------------------------------------------------------
@@ -1253,10 +1252,4 @@ extern void VG_(unimplemented) ( Char* m
__attribute__((__noreturn__));
-/* Similarly, we have to ask for signals to be delivered on an alternative
- stack, since it is possible, although unlikely, that we'll have to run
- client code from inside the Valgrind-installed signal handler. If this
- happens it will be done by vg_deliver_signal_immediately(). */
-extern UInt VG_(sigstack)[VG_SIGSTACK_SIZE_W];
-
/* Valgrind's argc and argv */
extern Int VG_(vg_argc);
@@ -1269,7 +1262,4 @@ extern void VG_(start_debugger) ( Int ti
extern UInt VG_(dispatch_ctr);
-/* This is the ThreadId of the last thread the scheduler ran. */
-extern ThreadId VG_(last_run_tid);
-
/* If we're doing the default action of a fatal signal */
extern jmp_buf* VG_(fatal_signal_jmpbuf_ptr);
--- valgrind/coregrind/vg_main.c #1.190:1.191
@@ -149,6 +149,4 @@ Char** VG_(client_envp);
Running stuff
------------------------------------------------------------------ */
-/* Our signal delivery stack. */
-UInt VG_(sigstack)[VG_SIGSTACK_SIZE_W];
/* jmp_buf for fatal signals; VG_(fatal_signal_jmpbuf_ptr) is NULL until
@@ -164,7 +162,4 @@ UInt VG_(dispatch_ctr);
ULong VG_(bbs_done);
-/* This is the ThreadId of the last thread the scheduler ran. */
-ThreadId VG_(last_run_tid) = 0;
-
/* Tell the logging mechanism whether we are logging to a file
descriptor or a socket descriptor. */
@@ -2680,4 +2675,6 @@ int main(int argc, char **argv)
vki_rlimit zero = { 0, 0 };
Int padfile;
+ ThreadId last_run_tid = 0; // Last thread the scheduler ran.
+
//============================================================
@@ -2974,5 +2971,5 @@ int main(int argc, char **argv)
VG_(fatal_signal_jmpbuf_ptr) = &fatal_signal_jmpbuf;
if (__builtin_setjmp(VG_(fatal_signal_jmpbuf_ptr)) == 0) {
- src = VG_(scheduler)( &exitcode );
+ src = VG_(scheduler)( &exitcode, &last_run_tid );
} else {
src = VgSrc_FatalSig;
@@ -3013,6 +3010,6 @@ int main(int argc, char **argv)
/* We're exiting, so nuke all the threads and clean up the proxy LWPs */
vg_assert(src == VgSrc_FatalSig ||
- VG_(threads)[VG_(last_run_tid)].status == VgTs_Runnable ||
- VG_(threads)[VG_(last_run_tid)].status == VgTs_WaitJoiner);
+ VG_(threads)[last_run_tid].status == VgTs_Runnable ||
+ VG_(threads)[last_run_tid].status == VgTs_WaitJoiner);
VG_(nuke_all_threads_except)(VG_INVALID_THREADID);
@@ -3022,5 +3019,5 @@ int main(int argc, char **argv)
switch (src) {
case VgSrc_ExitSyscall: /* the normal way out */
- vg_assert(VG_(last_run_tid) > 0 && VG_(last_run_tid) < VG_N_THREADS);
+ vg_assert(last_run_tid > 0 && last_run_tid < VG_N_THREADS);
VG_(proxy_shutdown)();
--- valgrind/coregrind/vg_mylibc.c #1.84:1.85
@@ -1090,11 +1090,11 @@ static inline ExeContext *get_real_execo
ExeContext *ec;
Addr esp, ebp;
- Addr stacktop;
+ Addr stacktop, sigstack_low, sigstack_high;
asm("movl %%ebp, %0; movl %%esp, %1" : "=r" (ebp), "=r" (esp));
stacktop = VG_(valgrind_end);
- if (esp >= (Addr)&VG_(sigstack)[0] &&
- esp < (Addr)&VG_(sigstack)[VG_SIGSTACK_SIZE_W])
- stacktop = (Addr)&VG_(sigstack)[VG_SIGSTACK_SIZE_W];
+ VG_(get_sigstack_bounds)( &sigstack_low, &sigstack_high );
+ if (esp >= sigstack_low && esp < sigstack_high)
+ stacktop = sigstack_high;
ec = VG_(get_ExeContext2)(ret, ebp, esp, stacktop);
--- valgrind/coregrind/vg_scheduler.c #1.166:1.167
@@ -845,5 +845,5 @@ void idle ( void )
* The specified number of basic blocks has gone by.
*/
-VgSchedReturnCode VG_(scheduler) ( Int* exitcode )
+VgSchedReturnCode VG_(scheduler) ( Int* exitcode, ThreadId* last_run_tid )
{
ThreadId tid, tid_next;
@@ -856,5 +856,5 @@ VgSchedReturnCode VG_(scheduler) ( Int*
/* Start with the root thread. tid in general indicates the
currently runnable/just-finished-running thread. */
- VG_(last_run_tid) = tid = 1;
+ *last_run_tid = tid = 1;
/* This is the top level scheduler loop. It falls into three
@@ -976,5 +976,5 @@ VgSchedReturnCode VG_(scheduler) ( Int*
while (True) {
- VG_(last_run_tid) = tid;
+ *last_run_tid = tid;
/* For stats purposes only. */
--- valgrind/coregrind/vg_signals.c #1.78:1.79
@@ -82,14 +82,4 @@
-/*
- - The following causes an infinite loop: start Hugs, Feb 2001
- version, and do Control-C at the prompt. There is an infinite
- series of sigints delivered (to the client); but also seemingly
- to valgrind, which is very strange. I don't know why.
-
- [I haven't re-tested this, but this is likely fixed - JSGF]
-*/
-
-
/* ---------------------------------------------------------------------
Forwards decls.
@@ -105,4 +95,22 @@ static const Char *signame(Int sigNo);
/* ---------------------------------------------------------------------
+ Signal stack
+ ------------------------------------------------------------------ */
+
+/* Valgrind's signal stack size, in words */
+#define VG_SIGSTACK_SIZE_W 10000
+
+/* We have to ask for signals to be delivered on an alternative
+ stack, since it is possible, although unlikely, that we'll have to run
+ client code from inside the Valgrind-installed signal handler. */
+static Addr sigstack[VG_SIGSTACK_SIZE_W];
+
+extern void VG_(get_sigstack_bounds)( Addr* low, Addr* high )
+{
+ *low = (Addr) & sigstack[0];
+ *high = (Addr) & sigstack[VG_SIGSTACK_SIZE_W];
+}
+
+/* ---------------------------------------------------------------------
HIGH LEVEL STUFF TO DO WITH SIGNALS: POLICY (MOSTLY)
------------------------------------------------------------------ */
@@ -2043,7 +2051,7 @@ void vg_sync_signalhandler ( Int sigNo,
we asked for. */
if (!(
- ((Char*)(&(VG_(sigstack)[0])) <= (Char*)(&dummy_local))
+ ((Char*)(&(sigstack[0])) <= (Char*)(&dummy_local))
&&
- ((Char*)(&dummy_local) < (Char*)(&(VG_(sigstack)[VG_SIGSTACK_SIZE_W])))
+ ((Char*)(&dummy_local) < (Char*)(&(sigstack[VG_SIGSTACK_SIZE_W])))
)
) {
@@ -2059,6 +2067,6 @@ void vg_sync_signalhandler ( Int sigNo,
}
- vg_assert((Char*)(&(VG_(sigstack)[0])) <= (Char*)(&dummy_local));
- vg_assert((Char*)(&dummy_local) < (Char*)(&(VG_(sigstack)[VG_SIGSTACK_SIZE_W])));
+ vg_assert((Char*)(&(sigstack[0])) <= (Char*)(&dummy_local));
+ vg_assert((Char*)(&dummy_local) < (Char*)(&(sigstack[VG_SIGSTACK_SIZE_W])));
/* Special fault-handling case. We can now get signals which can
@@ -2360,5 +2368,5 @@ void VG_(sigstartup_actions) ( void )
/* Register an alternative stack for our own signal handler to run on. */
- altstack_info.ss_sp = &(VG_(sigstack)[0]);
+ altstack_info.ss_sp = &(sigstack[0]);
altstack_info.ss_size = VG_SIGSTACK_SIZE_W * sizeof(UInt);
altstack_info.ss_flags = 0;
|
|
From: Nicholas N. <nj...@ca...> - 2004-08-07 17:52:41
|
CVS commit by nethercote:
De-globalise a few more counters.
M +13 -24 vg_include.h 1.227
M +10 -48 vg_main.c 1.190
M +3 -4 vg_translate.c 1.88
M +58 -18 vg_transtab.c 1.31
--- valgrind/coregrind/vg_include.h #1.226:1.227
@@ -1278,24 +1278,9 @@ extern Int VG_(fatal_sigNo); /* th
/* --- Counters, for informational purposes only. --- */
-/* Number of lookups which miss the fast tt helper. */
-extern UInt VG_(tt_fast_misses);
-
-/* Counts for TT/TC informational messages. */
-
-/* Number and total o/t size of translations overall. */
-extern UInt VG_(overall_in_count);
-extern UInt VG_(overall_in_osize);
-extern UInt VG_(overall_in_tsize);
-/* Number and total o/t size of discards overall. */
-extern UInt VG_(overall_out_count);
-extern UInt VG_(overall_out_osize);
-extern UInt VG_(overall_out_tsize);
-/* The number of discards of TT/TC. */
-extern UInt VG_(number_of_tc_discards);
-/* Counts of chain and unchain operations done. */
-extern UInt VG_(bb_enchain_count);
-extern UInt VG_(bb_dechain_count);
-/* Number of unchained jumps performed. */
-extern UInt VG_(unchained_jumps_done);
+// These counters must be declared here because they're maintained by
+// vg_dispatch.S.
+extern UInt VG_(bb_enchain_count); // Counts of chain operations done
+extern UInt VG_(bb_dechain_count); // Counts of unchain operations done
+extern UInt VG_(unchained_jumps_done); // Number of unchained jumps performed
extern void VG_(print_scheduler_stats) ( void );
@@ -1427,14 +1412,18 @@ extern void VG_(show_open_fds) ( void );
extern Addr VG_(tt_fast)[VG_TT_FAST_SIZE];
+extern void VG_(init_tt_tc) ( void );
extern void VG_(add_to_trans_tab) ( Addr orig_addr, Int orig_size,
Addr trans_addr, Int trans_size,
UShort jumps[VG_MAX_JUMPS]);
+extern Addr VG_(search_transtab) ( Addr original_addr );
-extern void VG_(invalidate_translations) ( Addr start, UInt range, Bool unchain_blocks );
+extern void VG_(invalidate_translations) ( Addr start, UInt range,
+ Bool unchain_blocks );
-extern void VG_(init_tt_tc) ( void );
+extern void VG_(sanity_check_tt_tc) ( void );
-extern void VG_(sanity_check_tc_tt) ( void );
-extern Addr VG_(search_transtab) ( Addr original_addr );
+extern void VG_(print_tt_tc_stats) ( void );
+
+extern Int VG_(get_bbs_translated) ( void );
/* ---------------------------------------------------------------------
--- valgrind/coregrind/vg_main.c #1.189:1.190
@@ -154,7 +154,7 @@ UInt VG_(sigstack)[VG_SIGSTACK_SIZE_W];
/* jmp_buf for fatal signals; VG_(fatal_signal_jmpbuf_ptr) is NULL until
the time is right that it can be used. */
-Int VG_(fatal_sigNo) = -1;
-jmp_buf* VG_(fatal_signal_jmpbuf_ptr) = NULL;
-jmp_buf fatal_signal_jmpbuf;
+ Int VG_(fatal_sigNo) = -1;
+ jmp_buf* VG_(fatal_signal_jmpbuf_ptr) = NULL;
+static jmp_buf fatal_signal_jmpbuf;
/* Counts downwards in VG_(run_innerloop). */
@@ -176,25 +176,8 @@ Bool VG_(logging_to_filedes) = True;
/*====================================================================*/
-/* Number of lookups which miss the fast tt helper. */
-UInt VG_(tt_fast_misses) = 0;
-
-
-/* Counts for TT/TC informational messages. */
-
-/* Number and total o/t size of translations overall. */
-UInt VG_(overall_in_count) = 0;
-UInt VG_(overall_in_osize) = 0;
-UInt VG_(overall_in_tsize) = 0;
-/* Number and total o/t size of discards overall. */
-UInt VG_(overall_out_count) = 0;
-UInt VG_(overall_out_osize) = 0;
-UInt VG_(overall_out_tsize) = 0;
-/* The number of discards of TT/TC. */
-UInt VG_(number_of_tc_discards) = 0;
-/* Counts of chain and unchain operations done. */
-UInt VG_(bb_enchain_count) = 0;
-UInt VG_(bb_dechain_count) = 0;
-/* Number of unchained jumps performed. */
-UInt VG_(unchained_jumps_done) = 0;
+// These ones maintained by vg_dispatch.S
+UInt VG_(bb_enchain_count) = 0; // Number of chain operations done
+UInt VG_(bb_dechain_count) = 0; // Number of unchain operations done
+UInt VG_(unchained_jumps_done) = 0; // Number of unchained jumps done
/* Counts pertaining to internal sanity checking. */
@@ -202,33 +185,12 @@ static UInt sanity_fast_count = 0;
static UInt sanity_slow_count = 0;
-static __inline__ Int safe_idiv(Int a, Int b)
-{
- return (b == 0 ? 0 : a / b);
-}
-
static void print_all_stats ( void )
{
// Translation stats
+ VG_(print_tt_tc_stats)();
VG_(message)(Vg_DebugMsg,
- " TT/TC: %d tc sectors discarded.",
- VG_(number_of_tc_discards) );
- VG_(message)(Vg_DebugMsg,
- " %d tt_fast misses.", VG_(tt_fast_misses));
- VG_(message)(Vg_DebugMsg,
- " %d chainings, %d unchainings.",
+ "chainings: %d chainings, %d unchainings.",
VG_(bb_enchain_count), VG_(bb_dechain_count) );
VG_(message)(Vg_DebugMsg,
- "translate: new %d (%d -> %d; ratio %d:10)",
- VG_(overall_in_count),
- VG_(overall_in_osize),
- VG_(overall_in_tsize),
- safe_idiv(10*VG_(overall_in_tsize), VG_(overall_in_osize)));
- VG_(message)(Vg_DebugMsg,
- " discard %d (%d -> %d; ratio %d:10).",
- VG_(overall_out_count),
- VG_(overall_out_osize),
- VG_(overall_out_tsize),
- safe_idiv(10*VG_(overall_out_tsize), VG_(overall_out_osize)));
- VG_(message)(Vg_DebugMsg,
" dispatch: %llu jumps (bb entries); of them %u (%lu%%) unchained.",
VG_(bbs_done),
@@ -2616,5 +2578,5 @@ void VG_(sanity_check_general) ( Bool fo
if ((sanity_fast_count % 250) == 0)
- VG_(sanity_check_tc_tt)();
+ VG_(sanity_check_tt_tc)();
if (VG_(needs).sanity_checks) {
--- valgrind/coregrind/vg_translate.c #1.87:1.88
@@ -2466,5 +2466,5 @@ void VG_(translate) ( ThreadId tid, Addr
notrace_until_limit to be the number of translations to be made
before --trace-codegen= style printing takes effect. */
- notrace_until_done = VG_(overall_in_count) >= notrace_until_limit;
+ notrace_until_done = VG_(get_bbs_translated)() >= notrace_until_limit;
seg = VG_(find_segment)(orig_addr);
@@ -2496,7 +2496,6 @@ void VG_(translate) ( ThreadId tid, Addr
VG_(get_fnname_if_entry)(orig_addr, fnname, 64);
VG_(printf)(
- "==== BB %d %s(%p) in %dB, out %dB, BBs exec'd %llu ====\n\n",
- VG_(overall_in_count), fnname, orig_addr,
- VG_(overall_in_osize), VG_(overall_in_tsize),
+ "==== BB %d %s(%p) approx BBs exec'd %llu ====\n\n",
+ VG_(get_bbs_translated)(), fnname, orig_addr,
VG_(bbs_done));
}
--- valgrind/coregrind/vg_transtab.c #1.30:1.31
@@ -122,4 +122,17 @@ static Int vg_tc_stats_osize[VG_TC_N_SEC
static Int vg_tc_stats_tsize[VG_TC_N_SECTORS];
+static UInt n_tt_fast_misses = 0; // number of lookups missing fast TT helper
+static UInt n_tc_discards = 0; // number of TT/TC discards
+
+// Number and total original/translated size of translations overall.
+static UInt overall_in_count = 0;
+static UInt overall_in_osize = 0;
+static UInt overall_in_tsize = 0;
+// Number and total original/t size of discards overall.
+static UInt overall_out_count = 0;
+static UInt overall_out_osize = 0;
+static UInt overall_out_tsize = 0;
+
+
/*------------------ TRANSLATION TABLE ------------------*/
@@ -354,12 +367,12 @@ void discard_oldest_sector ( void )
pp_tt_tc_status ( msg );
- VG_(overall_out_count) += vg_tc_stats_count[s];
- VG_(overall_out_osize) += vg_tc_stats_osize[s];
- VG_(overall_out_tsize) += vg_tc_stats_tsize[s];
+ overall_out_count += vg_tc_stats_count[s];
+ overall_out_osize += vg_tc_stats_osize[s];
+ overall_out_tsize += vg_tc_stats_tsize[s];
vg_tc_used[s] = 0;
vg_tc_stats_count[s] = 0;
vg_tc_stats_osize[s] = 0;
vg_tc_stats_tsize[s] = 0;
- VG_(number_of_tc_discards) ++;
+ n_tc_discards++;
}
}
@@ -375,5 +388,5 @@ Int maybe_commission_sector ( void )
for (s = 0; s < VG_TC_N_SECTORS; s++) {
if (vg_tc[s] != NULL && vg_tc_used[s] == 0) {
- vg_tc_age[s] = VG_(overall_in_count);
+ vg_tc_age[s] = overall_in_count;
VG_(sprintf)(msg, "after commission of sector %d "
"at time %d",
@@ -381,5 +394,5 @@ Int maybe_commission_sector ( void )
pp_tt_tc_status ( msg );
# ifdef DEBUG_TRANSTAB
- VG_(sanity_check_tc_tt)();
+ VG_(sanity_check_tt_tc)();
# endif
return s;
@@ -460,5 +473,5 @@ UChar* allocate ( Int nBytes )
vg_assert(vg_tc_current >= 0 && vg_tc_current < VG_TC_N_SECTORS);
# ifdef DEBUG_TRANSTAB
- VG_(sanity_check_tc_tt)();
+ VG_(sanity_check_tt_tc)();
# endif
@@ -481,5 +494,5 @@ void VG_(get_tt_tc_used) ( UInt* tt_used
/* Do a sanity check on TT/TC.
*/
-void VG_(sanity_check_tc_tt) ( void )
+void VG_(sanity_check_tt_tc) ( void )
{
Int i, s;
@@ -509,4 +522,31 @@ void VG_(sanity_check_tc_tt) ( void )
}
+static __inline__ Int safe_idiv(Int a, Int b)
+{
+ return (b == 0 ? 0 : a / b);
+}
+
+void VG_(print_tt_tc_stats)(void)
+{
+ VG_(message)(Vg_DebugMsg,
+ " TT/TC: %d tc sectors discarded.",
+ n_tc_discards );
+ VG_(message)(Vg_DebugMsg,
+ " %d tt_fast misses.",
+ n_tt_fast_misses);
+ VG_(message)(Vg_DebugMsg,
+ "translate: new %d (%d -> %d; ratio %d:10)",
+ overall_in_count, overall_in_osize, overall_in_tsize,
+ safe_idiv(10*overall_in_tsize, overall_in_osize));
+ VG_(message)(Vg_DebugMsg,
+ " discard %d (%d -> %d; ratio %d:10).",
+ overall_out_count, overall_out_osize, overall_out_tsize,
+ safe_idiv(10*overall_out_tsize, overall_out_osize));
+}
+
+Int VG_(get_bbs_translated) ( void )
+{
+ return overall_in_count;
+}
/* Add this already-filled-in entry to the TT. Assumes that the
@@ -554,7 +594,7 @@ void VG_(add_to_trans_tab) ( Addr orig_a
/* Update stats. */
- VG_(overall_in_count) ++;
- VG_(overall_in_osize) += orig_size;
- VG_(overall_in_tsize) += trans_size;
+ overall_in_count ++;
+ overall_in_osize += orig_size;
+ overall_in_tsize += trans_size;
vg_tc_stats_count[vg_tc_current] ++;
@@ -582,5 +622,5 @@ Addr VG_(search_transtab) ( Addr origina
UInt cno = (UInt)original_addr & VG_TT_FAST_MASK;
VG_(tt_fast)[cno] = (Addr)(tte->tcentry);
- VG_(tt_fast_misses)++;
+ n_tt_fast_misses++;
VGP_POPCC(VgpSlowFindT);
return (Addr)&(tte->tcentry->payload[0]);
@@ -601,5 +641,5 @@ void VG_(invalidate_translations) ( Addr
TCEntry* tce;
# ifdef DEBUG_TRANSTAB
- VG_(sanity_check_tc_tt)();
+ VG_(sanity_check_tt_tc)();
# endif
i_start = start;
@@ -631,7 +671,7 @@ void VG_(invalidate_translations) ( Addr
}
- VG_(overall_out_count) ++;
- VG_(overall_out_osize) += tce->orig_size;
- VG_(overall_out_tsize) += tce->trans_size;
+ overall_out_count ++;
+ overall_out_osize += tce->orig_size;
+ overall_out_tsize += tce->trans_size;
out_count ++;
out_osize += tce->orig_size;
@@ -641,5 +681,5 @@ void VG_(invalidate_translations) ( Addr
if (out_count > 0) {
vg_invalidate_tt_fast();
- VG_(sanity_check_tc_tt)();
+ VG_(sanity_check_tt_tc)();
# ifdef DEBUG_TRANSTAB
{ Addr aa;
@@ -706,5 +746,5 @@ void VG_(init_tt_tc) ( void )
# ifdef DEBUG_TRANSTAB
- VG_(sanity_check_tc_tt)();
+ VG_(sanity_check_tt_tc)();
# endif
}
|
|
From: Nicholas N. <nj...@ca...> - 2004-08-07 15:55:21
|
CVS commit by nethercote:
Add some missing 'static' annotations. Thanks to Josef W for spotting them.
M +4 -1 cg_main.c 1.75
--- valgrind/cachegrind/cg_main.c #1.74:1.75
@@ -358,4 +358,5 @@ void log_1I_2D_cache_access(instr_info*
/*------------------------------------------------------------*/
+static
BB_info* get_BB_info(UCodeBlock* cb_in, Addr orig_addr, Bool* bb_seen_before)
{
@@ -392,4 +393,5 @@ BB_info* get_BB_info(UCodeBlock* cb_in,
}
+static
void do_details( instr_info* n, Bool bb_seen_before,
Addr instr_addr, Int instr_size, Int data_size )
@@ -411,5 +413,5 @@ void do_details( instr_info* n, Bool bb_
}
-Bool is_valid_data_size(Int data_size)
+static Bool is_valid_data_size(Int data_size)
{
return (4 == data_size || 2 == data_size || 1 == data_size ||
@@ -418,4 +420,5 @@ Bool is_valid_data_size(Int data_size)
// Instrumentation for the end of each x86 instruction.
+static
void end_of_x86_instr(UCodeBlock* cb, instr_info* i_node, Bool bb_seen_before,
UInt instr_addr, UInt instr_size, UInt data_size,
|
|
From: <js...@ac...> - 2004-08-07 02:58:33
|
Nightly build on nemesis ( SuSE 9.1 ) started at 2004-08-07 03:50:00 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 169 tests, 4 stderr failures, 0 stdout failures ================= corecheck/tests/as_mmap (stderr) corecheck/tests/fdleak_fcntl (stderr) memcheck/tests/writev (stderr) memcheck/tests/zeropage (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <to...@co...> - 2004-08-07 02:25:13
|
Nightly build on dunsmere ( Fedora Core 2 ) started at 2004-08-07 03:20:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 7 stderr failures, 1 stdout failure ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/writev (stderr) none/tests/exec-sigmask (stdout) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-08-07 02:19:41
|
Nightly build on audi ( Red Hat 9 ) started at 2004-08-07 03:15:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 7 stderr failures, 0 stdout failures ================= corecheck/tests/fdleak_cmsg (stderr) corecheck/tests/fdleak_fcntl (stderr) corecheck/tests/fdleak_ipv4 (stderr) corecheck/tests/fdleak_socketpair (stderr) memcheck/tests/buflen_check (stderr) memcheck/tests/execve (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-08-07 02:08:14
|
Nightly build on alvis ( Red Hat 7.3 ) started at 2004-08-07 03:05:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 9 stderr failures, 1 stdout failure ================= addrcheck/tests/toobig-allocs (stderr) helgrind/tests/deadlock (stderr) helgrind/tests/race (stderr) helgrind/tests/race2 (stderr) memcheck/tests/badjump (stderr) memcheck/tests/brk (stderr) memcheck/tests/error_counts (stdout) memcheck/tests/new_nothrow (stderr) memcheck/tests/toobig-allocs (stderr) memcheck/tests/writev (stderr) make: *** [regtest] Error 1 |
|
From: Tom H. <th...@cy...> - 2004-08-07 02:06:51
|
Nightly build on standard ( Red Hat 7.2 ) started at 2004-08-07 03:00:02 BST Checking out source tree ... done Configuring ... done Building ... done Running regression tests ... done Last 20 lines of log.verbose follow rcrl: valgrind ./rcrl readline1: valgrind ./readline1 resolv: valgrind ./resolv rlimit_nofile: valgrind ./rlimit_nofile seg_override: valgrind ./seg_override sem: valgrind ./sem semlimit: valgrind ./semlimit sha1_test: valgrind ./sha1_test shortpush: valgrind ./shortpush shorts: valgrind ./shorts smc1: valgrind ./smc1 susphello: valgrind ./susphello syscall-restart1: valgrind ./syscall-restart1 syscall-restart2: valgrind ./syscall-restart2 system: valgrind ./system yield: valgrind ./yield -- Finished tests in none/tests ---------------------------------------- == 174 tests, 0 stderr failures, 0 stdout failures ================= |