aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/gpr
diff options
context:
space:
mode:
authorGravatar Muxi Yan <mxyan@google.com>2018-11-12 10:00:28 -0800
committerGravatar Muxi Yan <mxyan@google.com>2018-11-12 10:00:28 -0800
commitb8c9648f60a99cc8bd94f02c71bda240efba728a (patch)
tree646295126cba2882a689eada13702625868c0093 /src/core/lib/gpr
parent04cef1fd19fd77c5b758057fc844dca4c5c858a2 (diff)
Directly calling logging function to prevent dead-stripping
Diffstat (limited to 'src/core/lib/gpr')
-rw-r--r--src/core/lib/gpr/sync_posix.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/core/lib/gpr/sync_posix.cc b/src/core/lib/gpr/sync_posix.cc
index 69bd609485..dba58c72e7 100644
--- a/src/core/lib/gpr/sync_posix.cc
+++ b/src/core/lib/gpr/sync_posix.cc
@@ -30,11 +30,11 @@
// For debug of the timer manager crash only.
// TODO (mxyan): remove after bug is fixed.
#ifdef GRPC_DEBUG_TIMER_MANAGER
-void (*g_grpc_debug_timer_manager_stats)(
+void GRPCDebugTimerManagerLogStats(
int64_t timer_manager_init_count, int64_t timer_manager_shutdown_count,
int64_t fork_count, int64_t timer_wait_err, int64_t timer_cv_value,
int64_t timer_mu_value, int64_t abstime_sec_value,
- int64_t abstime_nsec_value) = nullptr;
+ int64_t abstime_nsec_value);
int64_t g_timer_manager_init_count = 0;
int64_t g_timer_manager_shutdown_count = 0;
int64_t g_fork_count = 0;
@@ -119,15 +119,13 @@ int gpr_cv_wait(gpr_cv* cv, gpr_mu* mu, gpr_timespec abs_deadline) {
// For debug of the timer manager crash only.
// TODO (mxyan): remove after bug is fixed.
if (GPR_UNLIKELY(!(err == 0 || err == ETIMEDOUT || err == EAGAIN))) {
- if (g_grpc_debug_timer_manager_stats) {
- g_timer_wait_err = err;
- g_timer_cv_value = (int64_t)cv;
- g_timer_mu_value = (int64_t)mu;
- g_grpc_debug_timer_manager_stats(
- g_timer_manager_init_count, g_timer_manager_shutdown_count,
- g_fork_count, g_timer_wait_err, g_timer_cv_value, g_timer_mu_value,
- g_abstime_sec_value, g_abstime_nsec_value);
- }
+ g_timer_wait_err = err;
+ g_timer_cv_value = (int64_t)cv;
+ g_timer_mu_value = (int64_t)mu;
+ GRPCDebugTimerManagerLogStats(
+ g_timer_manager_init_count, g_timer_manager_shutdown_count,
+ g_fork_count, g_timer_wait_err, g_timer_cv_value, g_timer_mu_value,
+ g_abstime_sec_value, g_abstime_nsec_value);
}
#endif
GPR_ASSERT(err == 0 || err == ETIMEDOUT || err == EAGAIN);