Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tsl/profiler/lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions tsl/profiler/lib/profiler_lock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.

#include <atomic>

#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "xla/tsl/platform/errors.h"
#include "xla/tsl/platform/macros.h"
Expand Down Expand Up @@ -49,13 +50,13 @@ static_assert(ATOMIC_INT_LOCK_FREE == 2, "Assumed atomic<int> 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);
}
Expand Down
Loading