ruby-changes:70640
From: Koichi <ko1@a...>
Date: Wed, 29 Dec 2021 00:22:17 +0900 (JST)
Subject: [ruby-changes:70640] c9af8a32a0 (master): `USE_RUBY_DEBUG_LOG` doesn't check `RUBY_DEVEL`
https://git.ruby-lang.org/ruby.git/commit/?id=c9af8a32a0 From c9af8a32a05b26d45c5c8967902b3a724f3c1be6 Mon Sep 17 00:00:00 2001 From: Koichi Sasada <ko1@a...> Date: Tue, 28 Dec 2021 17:58:39 +0900 Subject: `USE_RUBY_DEBUG_LOG` doesn't check `RUBY_DEVEL` `USE_RUBY_DEBUG_LOG` was only defined when `RUBY_DEVEL` is defined. This patch removes this dependency (`USE_RUBY_DEBUG_LOG` is defined independently from `RUBY_DEVEL`). Do not commit a patch which enables `USE_RUBY_DEBUG_LOG`. --- debug.c | 10 +++------- ractor.c | 2 +- transient_heap.c | 4 +--- vm_debug.h | 15 ++------------- vm_sync.h | 2 +- 5 files changed, 8 insertions(+), 25 deletions(-) diff --git a/debug.c b/debug.c index a5e6ce475a1..95a994e63c3 100644 --- a/debug.c +++ b/debug.c @@ -248,11 +248,7 @@ set_debug_option(const char *str, int len, void *arg) https://github.com/ruby/ruby/blob/trunk/debug.c#L248 } } -#ifdef USE_RUBY_DEBUG_LOG -STATIC_ASSERT(USE_RUBY_DEBUG_LOG, USE_RUBY_DEBUG_LOG ? RUBY_DEVEL : 1); -#endif - -#if RUBY_DEVEL +#if USE_RUBY_DEBUG_LOG static void setup_debug_log(void); #else #define setup_debug_log() @@ -265,7 +261,7 @@ ruby_set_debug_option(const char *str) https://github.com/ruby/ruby/blob/trunk/debug.c#L261 setup_debug_log(); } -#if RUBY_DEVEL +#if USE_RUBY_DEBUG_LOG // RUBY_DEBUG_LOG features // See vm_debug.h comments for details. @@ -511,4 +507,4 @@ ruby_debug_log_dump(const char *fname, unsigned int n) https://github.com/ruby/ruby/blob/trunk/debug.c#L507 fclose(fp); } } -#endif // #if RUBY_DEVEL +#endif // #if USE_RUBY_DEBUG_LOG diff --git a/ractor.c b/ractor.c index 3c05964e911..d6559dfc2af 100644 --- a/ractor.c +++ b/ractor.c @@ -545,7 +545,7 @@ ractor_sleep_interrupt(void *ptr) https://github.com/ruby/ruby/blob/trunk/ractor.c#L545 RACTOR_UNLOCK(r); } -#if defined(USE_RUBY_DEBUG_LOG) && USE_RUBY_DEBUG_LOG +#if USE_RUBY_DEBUG_LOG static const char * wait_status_str(enum ractor_wait_status wait_status) { diff --git a/transient_heap.c b/transient_heap.c index c3df2634911..ba6f87aa692 100644 --- a/transient_heap.c +++ b/transient_heap.c @@ -748,7 +748,7 @@ transient_heap_block_evacuate(struct transient_heap* theap, struct transient_hea https://github.com/ruby/ruby/blob/trunk/transient_heap.c#L748 } } -#if defined(USE_RUBY_DEBUG_LOG) && USE_RUBY_DEBUG_LOG +#if USE_RUBY_DEBUG_LOG static const char * transient_heap_status_cstr(enum transient_heap_status status) { @@ -964,8 +964,6 @@ void https://github.com/ruby/ruby/blob/trunk/transient_heap.c#L964 rb_transient_heap_finish_marking(void) { ASSERT_vm_locking(); - RUBY_DEBUG_LOG(""); - struct transient_heap* theap = transient_heap_get(); RUBY_DEBUG_LOG("objects:%d, marked:%d", diff --git a/vm_debug.h b/vm_debug.h index 803a7ccf4b6..f2c89a193b8 100644 --- a/vm_debug.h +++ b/vm_debug.h @@ -31,20 +31,9 @@ void ruby_set_debug_option(const char *str); https://github.com/ruby/ruby/blob/trunk/vm_debug.h#L31 RUBY_SYMBOL_EXPORT_END -#ifndef RUBY_DEVEL -# define RUBY_DEVEL 0 -#endif - -#if RUBY_DEVEL #ifndef USE_RUBY_DEBUG_LOG #define USE_RUBY_DEBUG_LOG 0 #endif -#else -// disable on !RUBY_DEVEL -#ifdef USE_RUBY_DEBUG_LOG -#undef USE_RUBY_DEBUG_LOG -#endif -#endif /* RUBY_DEBUG_LOG: Logging debug information mechanism * @@ -101,7 +90,7 @@ bool ruby_debug_log_filter(const char *func_name); https://github.com/ruby/ruby/blob/trunk/vm_debug.h#L90 // You can use this macro for temporary usage (you should not commit it). #define _RUBY_DEBUG_LOG(...) ruby_debug_log(__FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__) -#if defined(USE_RUBY_DEBUG_LOG) && USE_RUBY_DEBUG_LOG +#if USE_RUBY_DEBUG_LOG # define RUBY_DEBUG_LOG_ENABLED(func_name) \ (ruby_debug_log_mode && ruby_debug_log_filter(func_name)) @@ -115,7 +104,7 @@ bool ruby_debug_log_filter(const char *func_name); https://github.com/ruby/ruby/blob/trunk/vm_debug.h#L104 ruby_debug_log(file, line, RUBY_FUNCTION_NAME_STRING, "" __VA_ARGS__); \ } while (0) -#else +#else // USE_RUBY_DEBUG_LOG // do nothing #define RUBY_DEBUG_LOG(...) #define RUBY_DEBUG_LOG2(file, line, ...) diff --git a/vm_sync.h b/vm_sync.h index 0969e5bfc9c..4d83b5e52cb 100644 --- a/vm_sync.h +++ b/vm_sync.h @@ -4,7 +4,7 @@ https://github.com/ruby/ruby/blob/trunk/vm_sync.h#L4 #include "vm_debug.h" #include "debug_counter.h" -#if defined(USE_RUBY_DEBUG_LOG) && USE_RUBY_DEBUG_LOG +#if USE_RUBY_DEBUG_LOG #define LOCATION_ARGS const char *file, int line #define LOCATION_PARAMS file, line #define APPEND_LOCATION_ARGS , const char *file, int line -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/