]> granicus.if.org Git - gc/commitdiff
Turn on world-stop delay logging at debug level by default for Android
authorIvan Maidanski <ivmai@mail.ru>
Wed, 12 Dec 2012 19:45:32 +0000 (23:45 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 12 Dec 2012 19:45:32 +0000 (23:45 +0400)
* 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.

alloc.c
include/private/gc_priv.h

diff --git a/alloc.c b/alloc.c
index cf7bbaeb4bde84218dbbd57bbc603d43cb64a0bd..cfd9014933b6951e020f731fcc933c932d3a7979 100644 (file)
--- 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);
index 4c7608cd6b8e0b9296708aa2372b9c2bd8b13cbc..58b22e1bf65bc9e0dbb7ced0aeac18f09c20a72a 100644 (file)
@@ -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   */