|
From: Eyal L. <ey...@ey...> - 2003-03-17 13:29:27
|
Julian Seward wrote: > > Eyal > > It looks like a good patch, and a useful thing too. I would merge > it in, except there is one critical problem which needs fixing first. > > The patch uses a glibc function, time(), to get the time. We have > a policy that valgrind itself does not use any glibc functions or > headers. Is that so? I see a direct call to gettimeofday() in vg_libpthread.c #include <sys/time.h> /* gettimeofday */ and the include of <pthread.h> also brings in a few time related libc headers. So, I could not define the usual types and had to create new types (vg_time_t, struct vg_tm) and the related functions. Here is a second attempt at these options. The attached patch includes my toying with adjusting the sleep periods and switching to microsec periods (my 17h run finishes in under 7h now), I will send in a clean patch if the time-stamp part is acceptable. The relevant hunks are these (mostly the last one) coregrind/vg_errcontext.c print the timestamp coregrind/vg_include.h clo and my_libc declarations coregrind/vg_main.c clo handling coregrind/vg_mylibc.c VG_(time) and VG_(localtime) I can improve the performance of this implementation (stolen from the linux kernel, the handiest source at the time) and I should stress that this gives UTC, no attempt was done to implement the whole timezone business. I plan to extend the syntax of the option to allow --time-stamp=[+|-]mm:mm to set your local time offset manually, this should be good for most. Please check the code carefully, some of it is monkey see monkey do... -- Eyal Lebedinsky (ey...@ey...) <http://samba.org/eyal/> |