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); }