From: Ivan Maidanski Date: Wed, 12 Dec 2012 19:45:32 +0000 (+0400) Subject: Turn on world-stop delay logging at debug level by default for Android X-Git-Tag: gc7_4_0~115 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=34d29b8b697af4eac2f9a4dfbcdb0cf9d03f115e;p=gc Turn on world-stop delay logging at debug level by default for Android * alloc.c (GC_stopped_mark): Use GC_PRINT_STATS_FLAG instead of GC_print_stats in the condition for logging world-stop pause time. * include/private/gc_priv.h (GC_PRINT_STATS_FLAG): New macro (defined as !GC_quiet if GC_ANDROID_LOG otherwise as GC_print_stats. * include/private/gc_priv.h (GC_DBGLOG_PRINTF): Define using GC_PRINT_STATS_FLAG instead of GC_quiet; update comment. --- diff --git a/alloc.c b/alloc.c index cf7bbaeb..cfd90149 100644 --- a/alloc.c +++ b/alloc.c @@ -599,7 +599,7 @@ STATIC GC_bool GC_stopped_mark(GC_stop_func stop_func) # endif # ifndef SMALL_CONFIG - if (GC_print_stats) + if (GC_PRINT_STATS_FLAG) GET_TIME(start_time); # endif @@ -654,7 +654,7 @@ STATIC GC_bool GC_stopped_mark(GC_stop_func stop_func) # endif START_WORLD(); # ifndef SMALL_CONFIG - if (GC_print_stats) { + if (GC_PRINT_STATS_FLAG) { unsigned long time_diff; unsigned total_time, divisor; GET_TIME(current_time); diff --git a/include/private/gc_priv.h b/include/private/gc_priv.h index 4c7608cd..58b22e1b 100644 --- a/include/private/gc_priv.h +++ b/include/private/gc_priv.h @@ -2065,16 +2065,14 @@ GC_API_PRIV void GC_log_printf(const char * format, ...) #endif #ifndef GC_ANDROID_LOG -# define GC_DBGLOG_PRINTF GC_COND_LOG_PRINTF +# define GC_PRINT_STATS_FLAG (GC_print_stats != 0) # define GC_INFOLOG_PRINTF GC_COND_LOG_PRINTF /* GC_verbose_log_printf is called only if GC_print_stats is VERBOSE. */ # define GC_verbose_log_printf GC_log_printf #else extern GC_bool GC_quiet; - /* These loggers are enabled even if GC_print_stats is off. */ -# ifndef GC_DBGLOG_PRINTF -# define GC_DBGLOG_PRINTF if (GC_quiet) {} else GC_log_printf -# endif +# define GC_PRINT_STATS_FLAG (!GC_quiet) + /* INFO/DBG loggers are enabled even if GC_print_stats is off. */ # ifndef GC_INFOLOG_PRINTF # define GC_INFOLOG_PRINTF if (GC_quiet) {} else GC_info_log_printf # endif @@ -2088,6 +2086,9 @@ GC_API_PRIV void GC_log_printf(const char * format, ...) #define GC_COND_LOG_PRINTF if (!GC_print_stats) {} else GC_log_printf #define GC_VERBOSE_LOG_PRINTF \ if (GC_print_stats != VERBOSE) {} else GC_verbose_log_printf +#ifndef GC_DBGLOG_PRINTF +# define GC_DBGLOG_PRINTF if (!GC_PRINT_STATS_FLAG) {} else GC_log_printf +#endif void GC_err_puts(const char *s); /* Write s to stderr, don't buffer, don't add */