[vsipl++] [patch] fixes for profile timer 'realtime' option

Jules Bergmann jules at codesourcery.com
Wed Feb 22 16:47:08 UTC 2006


Don McCoy wrote:
> The attached patch fixes a minor problem with 
> --enable-profile-timer=realtime.  This option uses the function 
> clock_gettime(), which operates on a timespec structure instead of a 
> simple type like time_t.  This caused problems where the underlying type 
> 'stamp_type' was treated as an integer.

Don,

This looks good, please check it in

Instead of duplicating functionality for std::cout in dump(), can you 
change dump(char* filename, char mode) to special case the filename '-'? 
  Something like:

void
Profiler::dump(char* filename, char /*mode*/)
{
   std::ofstream    file;

   if (strcmp(filename, "-") == 0)
     file = std::cout;
   else
     file.open(filename);

   ... body ...

   if (strcmp(filename, "-") != 0)
     file.close();
}

Have you gotten file IO to work for mercury?

> 
> Note: Tested with ghs and gcc.  On RHEL, the options 
> CXXFLAGS=-D_POSIX_C_SOURCE=199309L LDFLAGS=-lrt are needed to include 
> the correct header definitions and link to the correct library.  These 
> options are not needed with the ghs compiler.  Should these be 
> incorporated into the configuration script, or is it better to require 
> they be provided explicitly?

No, lets leave that out of configure.ac for now.

				-- Jules



More information about the vsipl++ mailing list