diff --git a/ChangeLog b/ChangeLog index f6ea085..badea69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,19 +1,45 @@ -Fri Jun 6 14:44:13 PDT 2008 Valient Gough +Sat Nov 28 2009 Valient Gough + * fix printf arg warning + * add configure argument to disable variable clustering + * check for two-argument section attribute support + +Sun Nov 22 2009 Valient Gough + * avoid doc build failure if not building docs + +Tue Aug 18 2009 Valient Gough + * single char path length test + +Thu Nov 6 2008 Valient Gough + * fix off-by-one which cause single-char paths to be ignored + +Fri Jun 27 2008 Valient Gough + * simplify macros in rlog-c99 + * add test for gcc section attribute to configure + +Sat Jun 14 2008 Valient Gough + * add warning if timer isn't accurate enough to get good benchmark + results + * no longer use RDTSC function unless specifically requested during + configuration + * update configure using autoupdate + * bump version to 1.4 + * add global lock to RLog_Register function, to avoid race in threaded + apps + +Sat Jun 7 2008 Valient Gough + * add missing RLOG_SECTION definition + +Fri Jun 6 2008 Valient Gough + * update changelog * bump version to 1.3.8, lib version to 5 - -Fri Jun 6 14:33:37 PDT 2008 Valient Gough * import Windows VC80 patch from David Wolfe - -Fri Jun 6 14:31:01 PDT 2008 Valient Gough * minor fixes for Windows compile - -Fri Jun 6 14:16:04 PDT 2008 Valient Gough * use inline functions for modifying PublishLoc - -Fri Jun 6 14:14:17 PDT 2008 Valient Gough * add PublishLoc destructor. Struct initialization check hidden in out-of-band code. + * move enable flag to separate data segment for better cache locality + * minor code cleanup for enabled flag Fri Jun 6 13:45:00 PDT 2008 Valient Gough * move enable flag to separate data segment for better cache locality diff --git a/configure.ac b/configure.ac index 409a7e9..379e202 100644 --- a/configure.ac +++ b/configure.ac @@ -100,30 +100,46 @@ fi AC_SUBST(HAVE_PRINTF_FP_PROTOTYPE) -# check if we can use printf attribute on a function.. -AC_MSG_CHECKING(if section attribute works) -AC_COMPILE_IFELSE( [[ - extern void test(int val); - - int main() - { - static int foo __attribute__ (( section("RLOG_DATA") )) = 0; - - test( foo ); - - return 0; - } - ]], - with_section_attr="yes", - with_section_attr="no") -AC_MSG_RESULT($with_section_attr) -if test "x$with_section_attr" = "xyes"; then - HAVE_GCC_SECTION_ATTRIBUTE="1" -else - HAVE_GCC_SECTION_ATTRIBUTE="0" +AC_ARG_ENABLE(variable-clustering, + AS_HELP_STRING([--disable-variable-clustering], + [disables rlog variable clustering via separate data section]), + with_var_cluster=$enableval,with_var_cluster="test") + + +HAVE_GCC_DATA_SECTION_ATTRIBUTE="0" +HAVE_GCC_SIMPLE_SECTION_ATTRIBUTE="0" +if test "x$with_var_cluster" = "xtest"; then + # check if we can specify data section for variables + AC_MSG_CHECKING(if section attribute works) + with_section_attr="no" + AC_COMPILE_IFELSE( [[ + extern void test(int val); + + int main() + { + static int foo __attribute__ (( section("__DATA, RLOG_DATA") )) = 0; + test( foo ); + return 0; + } + ]], + [[HAVE_GCC_DATA_SECTION_ATTRIBUTE="1" + with_section_attr="yes"]]) + AC_COMPILE_IFELSE( [[ + extern void test(int val); + + int main() + { + static int foo __attribute__ (( section("RLOG_DATA") )) = 0; + test( foo ); + return 0; + } + ]], + [[HAVE_GCC_SIMPLE_SECTION_ATTRIBUTE="1" + with_section_attr="yes"]]) + AC_MSG_RESULT($with_section_attr) fi -AC_SUBST(HAVE_GCC_SECTION_ATTRIBUTE) - +AC_SUBST(HAVE_GCC_DATA_SECTION_ATTRIBUTE) +AC_SUBST(HAVE_GCC_SIMPLE_SECTION_ATTRIBUTE) AC_ARG_ENABLE(vararg, AS_HELP_STRING([--disable-vararg], diff --git a/rlog/StdioNode.cpp b/rlog/StdioNode.cpp index de2cd94..26e4c06 100644 --- a/rlog/StdioNode.cpp +++ b/rlog/StdioNode.cpp @@ -219,7 +219,7 @@ StdioNode::publish( const RLogData &data ) #ifndef _WIN32 if (outputThreadId) { char tid[16] = ""; - snprintf(tid,15,"%lu",pthread_self()); + snprintf(tid,15,"%p",pthread_self()); ss << "[tid:" << tid << "] "; } #endif diff --git a/rlog/common.h.in b/rlog/common.h.in index e06bc0c..3304ff2 100644 --- a/rlog/common.h.in +++ b/rlog/common.h.in @@ -53,7 +53,9 @@ # define PRINTF(FMT,X) __attribute__ (( __format__ ( __printf__, FMT, X))) # define HAVE_PRINTF_ATTR 1 -#if @HAVE_GCC_SECTION_ATTRIBUTE@ +#if @HAVE_GCC_DATA_SECTION_ATTRIBUTE@ +# define RLOG_SECTION __attribute__ (( section("__DATA, RLOG_DATA") )) +#elif @HAVE_GCC_SIMPLE_SECTION_ATTRIBUTE@ # define RLOG_SECTION __attribute__ (( section("RLOG_DATA") )) #else # define RLOG_SECTION