--- valgrind-1.9.4/coregrind/vg_errcontext.c Thu Feb 6 10:15:36 2003 +++ valgrind-1.9.4-e1/coregrind/vg_errcontext.c Fri Mar 14 21:26:14 2003 @@ -54,6 +54,8 @@ /* forwards ... */ static Supp* is_suppressible_error ( Error* err ); +/* get current time */ +static void vg_report_time_stamp (void); /*------------------------------------------------------------*/ /*--- Helper fns ---*/ @@ -98,6 +100,8 @@ VG_(pp_ExeContext) ( err->where ); } + if (VG_(clo_time_stamp) == True) + vg_report_time_stamp (); if (printCount) VG_(message)(Vg_UserMsg, "Observed %d times:", err->count ); if (err->tid > 1) @@ -762,6 +766,22 @@ } #undef STREQ + +#include /* time, localtime, timezone */ +#include /* gettimeofday */ + +static void vg_report_time_stamp (void) +{ + time_t t; + struct tm tm; + + t = time (NULL); + tm = *localtime (&t); + + VG_(message)(Vg_UserMsg, "Time: %d/%02d/%02d %02d:%02d:%02d", + tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec ); +} /*--------------------------------------------------------------------*/ /*--- end vg_errcontext.c ---*/ --- valgrind-1.9.4/coregrind/vg_main.c Tue Feb 25 08:21:54 2003 +++ valgrind-1.9.4-e1/coregrind/vg_main.c Fri Mar 14 20:32:37 2003 @@ -487,6 +487,7 @@ Char* VG_(clo_weird_hacks) = NULL; Bool VG_(clo_run_libc_freeres) = True; Bool VG_(clo_chain_bb) = True; +Bool VG_(clo_time_stamp) = False; /* This Bool is needed by wrappers in vg_clientmalloc.c to decide how @@ -567,6 +568,7 @@ " suppressions file \n" " --weird-hacks=hack1,hack2,... [no hacks selected]\n" " recognised hacks are: ioctl-VTIME truncate-writes lax-ioctls\n" +" --time-stamp=no|yes timestamp error reports? [no]\n" "\n" " %s skin user options:\n"; @@ -973,6 +975,11 @@ if (VG_(clo_backtrace_size) >= VG_DEEPEST_BACKTRACE) VG_(clo_backtrace_size) = VG_DEEPEST_BACKTRACE; } + + else if (STREQ(argv[i], "--time-stamp=yes")) + VG_(clo_time_stamp) = True; + else if (STREQ(argv[i], "--time-stamp=no")) + VG_(clo_time_stamp) = False; else if (VG_(needs).command_line_options) { Bool ok = SK_(process_cmd_line_option)(argv[i]); --- valgrind-1.9.4/coregrind/vg_include.h Tue Feb 25 08:21:53 2003 +++ valgrind-1.9.4-e1/coregrind/vg_include.h Fri Mar 14 20:09:26 2003 @@ -246,7 +246,8 @@ extern Bool VG_(clo_run_libc_freeres); /* Use the basic-block chaining optimisation? Default: YES */ extern Bool VG_(clo_chain_bb); - +/* report time of errors */ +extern Bool VG_(clo_time_stamp); /* --------------------------------------------------------------------- Debugging and profiling stuff