From adfd009d3a255b825ea91959620c11805418b22b Mon Sep 17 00:00:00 2001 From: AJ Heller Date: Thu, 12 May 2022 09:17:00 -0700 Subject: [PATCH] Make stack_tracer more broadly usable (#29660) These changes reduce the stack_tracer's dependencies, allowing it to be added to other targets such as `gpr_base` without dependency cycles. Why would I want to do this? printf debugging lock problems that only occur on the CI's Mac VMs, which we cannot access. --- BUILD | 19 +++++++++++++++++-- test/core/util/BUILD | 3 ++- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/BUILD b/BUILD index 1c36bac1887..0964ef27831 100644 --- a/BUILD +++ b/BUILD @@ -776,6 +776,22 @@ grpc_cc_library( ], ) +grpc_cc_library( + name = "examine_stack", + srcs = [ + "src/core/lib/gprpp/examine_stack.cc", + ], + hdrs = [ + "src/core/lib/gprpp/examine_stack.h", + ], + external_deps = [ + "absl/types:optional", + ], + deps = [ + "gpr_platform", + ], +) + grpc_cc_library( name = "gpr_base", srcs = [ @@ -810,7 +826,6 @@ grpc_cc_library( "src/core/lib/gpr/tmpfile_posix.cc", "src/core/lib/gpr/tmpfile_windows.cc", "src/core/lib/gpr/wrap_memcpy.cc", - "src/core/lib/gprpp/examine_stack.cc", "src/core/lib/gprpp/fork.cc", "src/core/lib/gprpp/global_config_env.cc", "src/core/lib/gprpp/host_port.cc", @@ -833,7 +848,6 @@ grpc_cc_library( "src/core/lib/gpr/string_windows.h", "src/core/lib/gpr/time_precise.h", "src/core/lib/gpr/tmpfile.h", - "src/core/lib/gprpp/examine_stack.h", "src/core/lib/gprpp/fork.h", "src/core/lib/gprpp/global_config.h", "src/core/lib/gprpp/global_config_custom.h", @@ -870,6 +884,7 @@ grpc_cc_library( deps = [ "construct_destruct", "debug_location", + "examine_stack", "google_rpc_status_upb", "gpr_codegen", "gpr_tls", diff --git a/test/core/util/BUILD b/test/core/util/BUILD index b464452f3b7..91e7a4d558f 100644 --- a/test/core/util/BUILD +++ b/test/core/util/BUILD @@ -171,7 +171,8 @@ grpc_cc_library( ], language = "C++", deps = [ - "//:grpc_common", + "//:examine_stack", + "//:gpr_platform", ], )