Commit 34dd639a by Derek Mauro Committed by Copybara-Service

Mutex: Remove the deprecated absl::RegisterSymbolizer() hook

absl::RegisterSymbolizer() has been deprecated for 5 years.
It is being removed following our compatibility policy.
<https://abseil.io/about/compatibility>
PiperOrigin-RevId: 532174866
Change-Id: Id5c3b86698e389099d3d707c4e57f30f1f155d2e
parent c15196ee
...@@ -103,9 +103,6 @@ ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES absl::base_internal::AtomicHook<void (*)( ...@@ -103,9 +103,6 @@ ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES absl::base_internal::AtomicHook<void (*)(
ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES
absl::base_internal::AtomicHook<void (*)(const char *msg, const void *cv)> absl::base_internal::AtomicHook<void (*)(const char *msg, const void *cv)>
cond_var_tracer; cond_var_tracer;
ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES absl::base_internal::AtomicHook<
bool (*)(const void *pc, char *out, int out_size)>
symbolizer(absl::Symbolize);
} // namespace } // namespace
...@@ -126,10 +123,6 @@ void RegisterCondVarTracer(void (*fn)(const char *msg, const void *cv)) { ...@@ -126,10 +123,6 @@ void RegisterCondVarTracer(void (*fn)(const char *msg, const void *cv)) {
cond_var_tracer.Store(fn); cond_var_tracer.Store(fn);
} }
void RegisterSymbolizer(bool (*fn)(const void *pc, char *out, int out_size)) {
symbolizer.Store(fn);
}
namespace { namespace {
// Represents the strategy for spin and yield. // Represents the strategy for spin and yield.
// See the comment in GetMutexGlobals() for more information. // See the comment in GetMutexGlobals() for more information.
...@@ -1289,7 +1282,7 @@ static inline void DebugOnlyLockLeave(Mutex *mu) { ...@@ -1289,7 +1282,7 @@ static inline void DebugOnlyLockLeave(Mutex *mu) {
static char *StackString(void **pcs, int n, char *buf, int maxlen, static char *StackString(void **pcs, int n, char *buf, int maxlen,
bool symbolize) { bool symbolize) {
static const int kSymLen = 200; static constexpr int kSymLen = 200;
char sym[kSymLen]; char sym[kSymLen];
int len = 0; int len = 0;
for (int i = 0; i != n; i++) { for (int i = 0; i != n; i++) {
...@@ -1297,7 +1290,7 @@ static char *StackString(void **pcs, int n, char *buf, int maxlen, ...@@ -1297,7 +1290,7 @@ static char *StackString(void **pcs, int n, char *buf, int maxlen,
return buf; return buf;
size_t count = static_cast<size_t>(maxlen - len); size_t count = static_cast<size_t>(maxlen - len);
if (symbolize) { if (symbolize) {
if (!symbolizer(pcs[i], sym, kSymLen)) { if (!absl::Symbolize(pcs[i], sym, kSymLen)) {
sym[0] = '\0'; sym[0] = '\0';
} }
snprintf(buf + len, count, "%s\t@ %p %s\n", (i == 0 ? "\n" : ""), pcs[i], snprintf(buf + len, count, "%s\t@ %p %s\n", (i == 0 ? "\n" : ""), pcs[i],
......
...@@ -1105,23 +1105,6 @@ void RegisterMutexTracer(void (*fn)(const char *msg, const void *obj, ...@@ -1105,23 +1105,6 @@ void RegisterMutexTracer(void (*fn)(const char *msg, const void *obj,
// RegisterMutexProfiler() above. // RegisterMutexProfiler() above.
void RegisterCondVarTracer(void (*fn)(const char *msg, const void *cv)); void RegisterCondVarTracer(void (*fn)(const char *msg, const void *cv));
// Register a hook for symbolizing stack traces in deadlock detector reports.
//
// 'pc' is the program counter being symbolized, 'out' is the buffer to write
// into, and 'out_size' is the size of the buffer. This function can return
// false if symbolizing failed, or true if a NUL-terminated symbol was written
// to 'out.'
//
// This has the same ordering and single-use limitations as
// RegisterMutexProfiler() above.
//
// DEPRECATED: The default symbolizer function is absl::Symbolize() and the
// ability to register a different hook for symbolizing stack traces will be
// removed on or after 2023-05-01.
ABSL_DEPRECATED("absl::RegisterSymbolizer() is deprecated and will be removed "
"on or after 2023-05-01")
void RegisterSymbolizer(bool (*fn)(const void *pc, char *out, int out_size));
// EnableMutexInvariantDebugging() // EnableMutexInvariantDebugging()
// //
// Enable or disable global support for Mutex invariant debugging. If enabled, // Enable or disable global support for Mutex invariant debugging. If enabled,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment