summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-12-12 23:45:32 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-12-12 23:45:32 +0400
commit34d29b8b697af4eac2f9a4dfbcdb0cf9d03f115e (patch)
tree76b1323cc18ad09d666a58c165825bbb3458955e
parent8072d4dddc958dfe92332c5a8e3b55e33ce3918c (diff)
downloadbdwgc-34d29b8b697af4eac2f9a4dfbcdb0cf9d03f115e.tar.gz
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.
-rw-r--r--alloc.c4
-rw-r--r--include/private/gc_priv.h11
2 files changed, 8 insertions, 7 deletions
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 */