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
|
2
|
3
(2) |
4
|
5
|
6
|
|
7
|
8
|
9
|
10
|
11
(2) |
12
(1) |
13
(1) |
|
14
(1) |
15
(2) |
16
(2) |
17
(5) |
18
(2) |
19
(1) |
20
(1) |
|
21
|
22
|
23
(1) |
24
(3) |
25
|
26
|
27
|
|
28
|
29
(1) |
30
|
31
(1) |
|
|
|
|
From: Ivo R. <ir...@so...> - 2018-01-20 19:56:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=bd077baa71a40b60dcf0286b9fb89d803323fd93 commit bd077baa71a40b60dcf0286b9fb89d803323fd93 Author: Ivo Raisr <iv...@iv...> Date: Fri Jan 19 16:12:34 2018 +0000 Add a simple progress-reporting facility. Fixes BZ#384633. Patch by: Julian Seward <js...@ac...> Diff: --- NEWS | 1 + coregrind/m_libcproc.c | 34 ++++++++++++++++++++++++ coregrind/m_main.c | 4 +++ coregrind/m_options.c | 2 ++ coregrind/m_scheduler/scheduler.c | 55 +++++++++++++++++++++++++++++++++++++++ coregrind/m_transtab.c | 5 ++++ coregrind/pub_core_options.h | 2 ++ docs/xml/manual-core.xml | 54 ++++++++++++++++++++++++++++++++++++++ include/pub_tool_libcproc.h | 9 +++++-- include/vki/vki-linux.h | 5 ++++ none/tests/cmdline2.stdout.exp | 2 ++ 11 files changed, 171 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 46c4db2..ac73dde 100644 --- a/NEWS +++ b/NEWS @@ -72,6 +72,7 @@ where XXXXXX is the bug number as listed below. 384096 Mention AddrCheck at Memcheck's command line option --undef-value-errors=no 384526 reduce number of spill instructions generated by VEX register allocator v3 384584 Callee saved registers listed first for AMD64, X86, and PPC architectures +384633 Add a simple progress-reporting facility 384987 VEX register allocator: allocate caller-save registers for short lived vregs 385182 PPC64 is missing support for the DSCR 385207 PPC64, generate_store_FPRF() generates too many Iops diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c index afcc117..97a4fc5 100644 --- a/coregrind/m_libcproc.c +++ b/coregrind/m_libcproc.c @@ -958,6 +958,40 @@ Int VG_(gettimeofday)(struct vki_timeval *tv, struct vki_timezone *tz) return -1; } +UInt VG_(get_user_milliseconds)(void) +{ + UInt res = 0; +# if defined(VGO_linux) + { + struct vki_rusage ru; + VG_(memset)(&ru, 0, sizeof(ru)); + SysRes sr = VG_(do_syscall2)(__NR_getrusage, VKI_RUSAGE_SELF, (UWord)&ru); + if (!sr_isError(sr)) { + res = ru.ru_utime.tv_sec * 1000 + ru.ru_utime.tv_usec / 1000; + } + } + +# elif defined(VGO_solaris) + { + struct vki_rusage ru; + VG_(memset)(&ru, 0, sizeof(ru)); + SysRes sr = VG_(do_syscall2)(__NR_rusagesys, VKI__RUSAGESYS_GETRUSAGE, + (UWord) &ru); + if (!sr_isError(sr)) { + res = ru.ru_utime.tv_sec * 1000 + ru.ru_utime.tv_usec / 1000; + } + } + +# elif defined(VGO_darwin) + res = 0; + +# else +# error "Unknown OS" +# endif + + return res; +} + /* --------------------------------------------------------------------- atfork() diff --git a/coregrind/m_main.c b/coregrind/m_main.c index a7574c3..bf4a712 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -258,6 +258,8 @@ static void usage_NORETURN ( Bool debug_help ) " heap blocks allocated for Valgrind internal use (in bytes) [4]\n" " --wait-for-gdb=yes|no pause on startup to wait for gdb attach\n" " --sym-offsets=yes|no show syms in form 'name+offset'? [no]\n" +" --progress-interval=<number> report progress every <number>\n" +" CPU seconds [0, meaning disabled]\n" " --command-line-only=no|yes only use command line options [no]\n" "\n" " Vex options for all Valgrind tools:\n" @@ -671,6 +673,8 @@ void main_process_cmd_line_options( void ) else if VG_BOOL_CLO(arg, "--trace-syscalls", VG_(clo_trace_syscalls)) {} else if VG_BOOL_CLO(arg, "--wait-for-gdb", VG_(clo_wait_for_gdb)) {} else if VG_BOOL_CLO(arg, "--sym-offsets", VG_(clo_sym_offsets)) {} + else if VG_BINT_CLO(arg, "--progress-interval", + VG_(clo_progress_interval), 0, 3600) {} else if VG_BOOL_CLO(arg, "--read-inline-info", VG_(clo_read_inline_info)) {} else if VG_BOOL_CLO(arg, "--read-var-info", VG_(clo_read_var_info)) {} diff --git a/coregrind/m_options.c b/coregrind/m_options.c index 72173dd..67eed34 100644 --- a/coregrind/m_options.c +++ b/coregrind/m_options.c @@ -110,6 +110,8 @@ enum FairSchedType VG_(clo_fair_sched) = disable_fair_sched; Bool VG_(clo_trace_sched) = False; Bool VG_(clo_profile_heap) = False; +UInt VG_(clo_progress_interval) = 0; /* in seconds, 1 .. 3600, + or 0 == disabled */ Int VG_(clo_core_redzone_size) = CORE_REDZONE_DEFAULT_SZB; // A value != -1 overrides the tool-specific value // VG_(needs_malloc_replacement).tool_client_redzone_szB diff --git a/coregrind/m_scheduler/scheduler.c b/coregrind/m_scheduler/scheduler.c index 54b8008..2ffcf4b 100644 --- a/coregrind/m_scheduler/scheduler.c +++ b/coregrind/m_scheduler/scheduler.c @@ -172,6 +172,56 @@ static struct sched_lock *the_BigLock; Helper functions for the scheduler. ------------------------------------------------------------------ */ +static void maybe_progress_report ( UInt reporting_interval_seconds ) +{ + /* This is when the next report is due, in user cpu milliseconds since + process start. This is a global variable so this won't be thread-safe + if Valgrind is ever made multithreaded. For now it's fine. */ + static UInt next_report_due_at = 0; + + /* First of all, figure out whether another report is due. It + probably isn't. */ + UInt user_ms = VG_(get_user_milliseconds)(); + if (LIKELY(user_ms < next_report_due_at)) + return; + + Bool first_ever_call = next_report_due_at == 0; + + /* A report is due. First, though, set the time for the next report. */ + next_report_due_at += 1000 * reporting_interval_seconds; + + /* If it's been an excessively long time since the last check, we + might have gone more than one reporting interval forward. Guard + against that. */ + while (next_report_due_at <= user_ms) + next_report_due_at += 1000 * reporting_interval_seconds; + + /* Also we don't want to report anything on the first call, but we + have to wait till this point to leave, so that we set up the + next-call time correctly. */ + if (first_ever_call) + return; + + /* Print the report. */ + UInt user_cpu_seconds = user_ms / 1000; + UInt wallclock_seconds = VG_(read_millisecond_timer)() / 1000; + Double millionEvCs = ((Double)bbs_done) / 1000000.0; + Double thousandTIns = ((Double)VG_(get_bbs_translated)()) / 1000.0; + Double thousandTOuts = ((Double)VG_(get_bbs_discarded_or_dumped)()) / 1000.0; + UInt nThreads = VG_(count_living_threads)(); + + if (VG_(clo_verbosity) > 0) { + VG_(dmsg)("PROGRESS: U %'us, W %'us, %.1f%% CPU, EvC %.2fM, " + "TIn %.1fk, TOut %.1fk, #thr %u\n", + user_cpu_seconds, wallclock_seconds, + 100.0 + * (Double)(user_cpu_seconds) + / (Double)(wallclock_seconds == 0 ? 1 : wallclock_seconds), + millionEvCs, + thousandTIns, thousandTOuts, nThreads); + } +} + static void print_sched_event ( ThreadId tid, const HChar* what ) { @@ -1315,6 +1365,11 @@ VgSchedReturnCode VG_(scheduler) ( ThreadId tid ) scheduler_sanity(tid); VG_(sanity_check_general)(False); + /* Possibly make a progress report */ + if (UNLIKELY(VG_(clo_progress_interval) > 0)) { + maybe_progress_report( VG_(clo_progress_interval) ); + } + /* Look for any pending signals for this thread, and set them up for delivery */ VG_(poll_signals)(tid); diff --git a/coregrind/m_transtab.c b/coregrind/m_transtab.c index fa0a868..6ef9cea 100644 --- a/coregrind/m_transtab.c +++ b/coregrind/m_transtab.c @@ -2565,6 +2565,11 @@ UInt VG_(get_bbs_translated) ( void ) return n_in_count; } +UInt VG_(get_bbs_discarded_or_dumped) ( void ) +{ + return n_disc_count + n_dump_count; +} + void VG_(print_tt_tc_stats) ( void ) { VG_(message)(Vg_DebugMsg, diff --git a/coregrind/pub_core_options.h b/coregrind/pub_core_options.h index cc6bb83..3bae7f3 100644 --- a/coregrind/pub_core_options.h +++ b/coregrind/pub_core_options.h @@ -201,6 +201,8 @@ extern enum FairSchedType VG_(clo_fair_sched); extern Bool VG_(clo_trace_sched); /* DEBUG: do heap profiling? default: NO */ extern Bool VG_(clo_profile_heap); +// DEBUG: report progress every N seconds (1 .. 3600) +extern UInt VG_(clo_progress_interval); #define MAX_REDZONE_SZB 128 // Maximum for the default values for core arenas and for client // arena given by the tool. diff --git a/docs/xml/manual-core.xml b/docs/xml/manual-core.xml index 6a03882..48321ac 100644 --- a/docs/xml/manual-core.xml +++ b/docs/xml/manual-core.xml @@ -2581,6 +2581,60 @@ need to use them.</para> </listitem> </varlistentry> + <varlistentry id="opt.progress-interval" xreflabel="--progress-interval"> + <term> + <option><![CDATA[--progress-interval=<number> [default: 0, meaning 'disabled'] ]]></option> + </term> + <listitem> + <para>This is an enhancement to Valgrind's debugging output. It is + unlikely to be of interest to end users.</para> + <para>When <varname>number</varname> is set to a non-zero value, + Valgrind will print a one-line progress summary + every <varname>number</varname> seconds. Valid settings + for <varname>number</varname> are between 0 and 3600 + inclusive. Here's some example output + with <varname>number</varname> + set to 10: + <programlisting><![CDATA[ +PROGRESS: U 110s, W 113s, 97.3% CPU, EvC 414.79M, TIn 616.7k, TOut 0.5k, #thr 67 +PROGRESS: U 120s, W 124s, 96.8% CPU, EvC 505.27M, TIn 636.6k, TOut 3.0k, #thr 64 +PROGRESS: U 130s, W 134s, 97.0% CPU, EvC 574.90M, TIn 657.5k, TOut 3.0k, #thr 63 +]]></programlisting> + Each line shows: + <itemizedlist> + <listitem><varname>U</varname>: total user time</listitem> + <listitem><varname>W</varname>: total wallclock time</listitem> + <listitem><varname>CPU</varname>: overall average cpu use</listitem> + <listitem><varname>EvC</varname>: number of event checks. An event + check is a backwards branch in the simulated program, so this is a + measure of forward progress of the program</listitem> + <listitem><varname>TIn</varname>: number of code blocks instrumented + by the JIT</listitem> + <listitem><varname>TOut</varname>: number of instrumented code + blocks that have been thrown away</listitem> + <listitem><varname>#thr</varname>: number of threads in the + program</listitem> + </itemizedlist> + From the progress of these, it is possible to observe: + <itemizedlist> + <listitem>when the program is compute bound (<varname>TIn</varname> + rises slowly, <varname>EvC</varname> rises rapidly)</listitem> + <listitem>when the program is in a spinloop + (<varname>TIn</varname>/<varname>TOut</varname> + fixed, <varname>EvC</varname> rises rapidly)</listitem> + <listitem>when the program is JIT-bound (<varname>TIn</varname> + rises rapidly)</listitem> + <listitem>when the program is rapidly discarding code + (<varname>TOut</varname> rises rapidly)</listitem> + <listitem>when the program is about to achieve some expected state + (<varname>EvC</varname> arrives at some value you + expect)</listitem> + <listitem> when the program is idling (<varname>U</varname> rises + more slowly than <varname>W</varname>)</listitem> + </itemizedlist> + </para> + </listitem> + </varlistentry> </variablelist> <!-- end of xi:include in the manpage --> diff --git a/include/pub_tool_libcproc.h b/include/pub_tool_libcproc.h index a3a186b..96b6d68 100644 --- a/include/pub_tool_libcproc.h +++ b/include/pub_tool_libcproc.h @@ -98,12 +98,17 @@ extern Int VG_(getegid) ( void ); Timing ------------------------------------------------------------------ */ -// Returns the number of milliseconds passed since the progam started +// Returns the number of milliseconds passed since the program started // (roughly; it gets initialised partway through Valgrind's initialisation -// steps). +// steps). This is wallclock time. extern UInt VG_(read_millisecond_timer) ( void ); + extern Int VG_(gettimeofday)(struct vki_timeval *tv, struct vki_timezone *tz); +// Returns the number of milliseconds of user cpu time we have used, +// as reported by 'getrusage'. +extern UInt VG_(get_user_milliseconds)(void); + /* --------------------------------------------------------------------- atfork ------------------------------------------------------------------ */ diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index 4840a53..faacf7f 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -971,6 +971,11 @@ struct vki_sctp_getaddrs { // From linux-2.6.8.1/include/linux/resource.h //---------------------------------------------------------------------- +#define VKI_RUSAGE_SELF 0 +#define VKI_RUSAGE_CHILDREN (-1) +#define VKI_RUSAGE_BOTH (-2) /* sys_wait4() uses this */ +#define VKI_RUSAGE_THREAD 1 /* only the calling thread */ + struct vki_rusage { struct vki_timeval ru_utime; /* user time used */ struct vki_timeval ru_stime; /* system time used */ diff --git a/none/tests/cmdline2.stdout.exp b/none/tests/cmdline2.stdout.exp index 2599a1b..fb42abb 100644 --- a/none/tests/cmdline2.stdout.exp +++ b/none/tests/cmdline2.stdout.exp @@ -170,6 +170,8 @@ usage: valgrind [options] prog-and-args heap blocks allocated for Valgrind internal use (in bytes) [4] --wait-for-gdb=yes|no pause on startup to wait for gdb attach --sym-offsets=yes|no show syms in form 'name+offset'? [no] + --progress-interval=<number> report progress every <number> + CPU seconds [0, meaning disabled] --command-line-only=no|yes only use command line options [no] Vex options for all Valgrind tools: |