diff --git a/src/core/lib/iomgr/ev_apple.cc b/src/core/lib/iomgr/ev_apple.cc index 77a9c4ee8e1..98607ea6441 100644 --- a/src/core/lib/iomgr/ev_apple.cc +++ b/src/core/lib/iomgr/ev_apple.cc @@ -117,7 +117,8 @@ static void grpc_apple_register_write_stream_queue( /// the global run loop thread gGlobalRunLoopThread. static void grpc_apple_register_read_stream_run_loop( CFReadStreamRef read_stream, dispatch_queue_t /*dispatch_queue*/) { - GRPC_POLLING_TRACE("Register read stream: %p", read_stream); + GRPC_TRACE_VLOG(apple_polling, 2) + << "(polling) Register read stream: " << read_stream; grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu); CFReadStreamScheduleWithRunLoop(read_stream, gGlobalRunLoopContext->run_loop, kCFRunLoopDefaultMode); @@ -130,7 +131,8 @@ static void grpc_apple_register_read_stream_run_loop( /// by the global run loop thread gGlobalRunLoopThread. static void grpc_apple_register_write_stream_run_loop( CFWriteStreamRef write_stream, dispatch_queue_t /*dispatch_queue*/) { - GRPC_POLLING_TRACE("Register write stream: %p", write_stream); + GRPC_TRACE_VLOG(apple_polling, 2) + << "(polling) Register write stream: " << write_stream; grpc_core::MutexLock lock(&gGlobalRunLoopContext->mu); CFWriteStreamScheduleWithRunLoop( write_stream, gGlobalRunLoopContext->run_loop, kCFRunLoopDefaultMode); @@ -220,9 +222,9 @@ static void pollset_global_shutdown(void) { static grpc_error_handle pollset_work(grpc_pollset* pollset, grpc_pollset_worker** worker, grpc_core::Timestamp deadline) { - GRPC_POLLING_TRACE("pollset work: %p, worker: %p, deadline: %" PRIu64, - pollset, worker, - deadline.milliseconds_after_process_epoch()); + GRPC_TRACE_VLOG(apple_polling, 2) + << "(polling) pollset work: " << pollset << ", worker: " << worker + << ", deadline: " << deadline.milliseconds_after_process_epoch(); GrpcApplePollset* apple_pollset = reinterpret_cast(pollset); GrpcAppleWorker actual_worker; @@ -276,7 +278,8 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset, GrpcApplePollset* apple_pollset = reinterpret_cast(pollset); - GRPC_POLLING_TRACE("pollset kick: %p, worker:%p", pollset, specific_worker); + GRPC_TRACE_VLOG(apple_polling, 2) << "(polling) pollset kick: " << pollset + << ", worker:" << specific_worker; if (specific_worker == nullptr) { if (apple_pollset->workers.empty()) { @@ -299,7 +302,7 @@ static grpc_error_handle pollset_kick(grpc_pollset* pollset, } static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) { - GRPC_POLLING_TRACE("pollset init: %p", pollset); + GRPC_TRACE_VLOG(apple_polling, 2) << "(polling) pollset init: " << pollset; GrpcApplePollset* apple_pollset = new (pollset) GrpcApplePollset(); *mu = grpc_core::GetUnderlyingGprMu(&apple_pollset->mu); } @@ -307,7 +310,8 @@ static void pollset_init(grpc_pollset* pollset, gpr_mu** mu) { /// The caller must acquire the lock GrpcApplePollset.mu before calling this /// function. static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) { - GRPC_POLLING_TRACE("pollset shutdown: %p", pollset); + GRPC_TRACE_VLOG(apple_polling, 2) + << "(polling) pollset shutdown: " << pollset; GrpcApplePollset* apple_pollset = reinterpret_cast(pollset); @@ -323,7 +327,7 @@ static void pollset_shutdown(grpc_pollset* pollset, grpc_closure* closure) { } static void pollset_destroy(grpc_pollset* pollset) { - GRPC_POLLING_TRACE("pollset destroy: %p", pollset); + GRPC_TRACE_VLOG(apple_polling, 2) << "(polling) pollset destroy: " << pollset; GrpcApplePollset* apple_pollset = reinterpret_cast(pollset); apple_pollset->~GrpcApplePollset(); diff --git a/src/core/lib/iomgr/ev_posix.cc b/src/core/lib/iomgr/ev_posix.cc index d7206d421cf..c8983966ada 100644 --- a/src/core/lib/iomgr/ev_posix.cc +++ b/src/core/lib/iomgr/ev_posix.cc @@ -166,7 +166,8 @@ bool grpc_event_engine_run_in_background(void) { grpc_fd* grpc_fd_create(int fd, const char* name, bool track_err) { GRPC_POLLING_API_TRACE("fd_create(%d, %s, %d)", fd, name, track_err); - GRPC_FD_TRACE("fd_create(%d, %s, %d)", fd, name, track_err); + GRPC_TRACE_LOG(fd_trace, INFO) << "(fd-trace) fd_create(" << fd << ", " + << name << ", " << track_err << ")"; return g_event_engine->fd_create( fd, name, track_err && grpc_event_engine_can_track_errors()); } @@ -179,20 +180,24 @@ void grpc_fd_orphan(grpc_fd* fd, grpc_closure* on_done, int* release_fd, const char* reason) { GRPC_POLLING_API_TRACE("fd_orphan(%d, %p, %p, %s)", grpc_fd_wrapped_fd(fd), on_done, release_fd, reason); - GRPC_FD_TRACE("grpc_fd_orphan, fd:%d closed", grpc_fd_wrapped_fd(fd)); + GRPC_TRACE_LOG(fd_trace, INFO) + << "(fd-trace) grpc_fd_orphan, fd:" << grpc_fd_wrapped_fd(fd) + << " closed"; g_event_engine->fd_orphan(fd, on_done, release_fd, reason); } void grpc_fd_set_pre_allocated(grpc_fd* fd) { GRPC_POLLING_API_TRACE("fd_set_pre_allocated(%d)", grpc_fd_wrapped_fd(fd)); - GRPC_FD_TRACE("fd_set_pre_allocated(%d)", grpc_fd_wrapped_fd(fd)); + GRPC_TRACE_LOG(fd_trace, INFO) + << "(fd-trace) fd_set_pre_allocated(" << grpc_fd_wrapped_fd(fd) << ")"; g_event_engine->fd_set_pre_allocated(fd); } void grpc_fd_shutdown(grpc_fd* fd, grpc_error_handle why) { GRPC_POLLING_API_TRACE("fd_shutdown(%d)", grpc_fd_wrapped_fd(fd)); - GRPC_FD_TRACE("fd_shutdown(%d)", grpc_fd_wrapped_fd(fd)); + GRPC_TRACE_LOG(fd_trace, INFO) + << "(fd-trace) fd_shutdown(" << grpc_fd_wrapped_fd(fd) << ")"; g_event_engine->fd_shutdown(fd, why); }