From 535f7e47effa9a0d323a893250a3e9ceafc05afc Mon Sep 17 00:00:00 2001 From: Ilya Tikhonovskiy Date: Fri, 20 Feb 2026 09:01:59 -0800 Subject: [PATCH] Migrate deprecated tsl::errors to absl equivalents. PiperOrigin-RevId: 872924754 --- tsl/profiler/lib/BUILD | 1 + tsl/profiler/lib/profiler_lock.cc | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tsl/profiler/lib/BUILD b/tsl/profiler/lib/BUILD index d75e7fef3..87120c0af 100644 --- a/tsl/profiler/lib/BUILD +++ b/tsl/profiler/lib/BUILD @@ -152,6 +152,7 @@ cc_library( "@xla//xla/tsl/profiler:xla_internal", ]), deps = [ + "@com_google_absl//absl/status", "@com_google_absl//absl/status:statusor", "@com_google_absl//absl/strings:string_view", "@xla//xla/tsl/platform:errors", diff --git a/tsl/profiler/lib/profiler_lock.cc b/tsl/profiler/lib/profiler_lock.cc index b226bd239..8dc04af74 100644 --- a/tsl/profiler/lib/profiler_lock.cc +++ b/tsl/profiler/lib/profiler_lock.cc @@ -16,6 +16,7 @@ limitations under the License. #include +#include "absl/status/status.h" #include "absl/status/statusor.h" #include "xla/tsl/platform/errors.h" #include "xla/tsl/platform/macros.h" @@ -49,13 +50,13 @@ static_assert(ATOMIC_INT_LOCK_FREE == 2, "Assumed atomic was lock free"); return disabled; }(); if (TF_PREDICT_FALSE(tf_profiler_disabled)) { - return errors::AlreadyExists( + return absl::AlreadyExistsError( "TensorFlow Profiler is permanently disabled by env var " "TF_DISABLE_PROFILING."); } int already_active = g_session_active.exchange(1, std::memory_order_acq_rel); if (already_active) { - return errors::AlreadyExists(kProfilerLockContention); + return absl::AlreadyExistsError(kProfilerLockContention); } return ProfilerLock(/*active=*/true); }