# Copyright 2026 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================

# Description:
# profile_utils targets.

load(
    "//tensorflow:tensorflow.bzl",
    "tf_copts",  # @unused
)
load("//tensorflow:tensorflow.default.bzl", "filegroup")
load(
    "//tensorflow/core/platform:rules_cc.bzl",
    "cc_library",
)

package(
    # copybara:uncomment default_applicable_licenses = ["//tensorflow:license"],
    default_visibility = [
        "//tensorflow/core:__pkg__",
        "//tensorflow/core/default:__pkg__",
        "//tensorflow/core/platform:__pkg__",
    ],
    licenses = ["notice"],
)

exports_files(srcs = [
    "android_armv7a_cpu_utils_helper.h",
    "clock_cycle_profiler.h",
    "cpu_utils.h",
    "i_cpu_utils_helper.h",
])

filegroup(
    name = "legacy_lib_internal_srcs",
    srcs = [
        "@xla//xla/tsl/platform/profile_utils:legacy_lib_internal_srcs",
    ],
    visibility = ["//tensorflow/core/platform:__pkg__"],
)

cc_library(
    name = "profile_utils_cpu_utils",
    srcs = [
        "android_armv7a_cpu_utils_helper.h",
        "i_cpu_utils_helper.h",
        "@xla//xla/tsl/platform/profile_utils:android_armv7a_cpu_utils_helper.h",
        "@xla//xla/tsl/platform/profile_utils:i_cpu_utils_helper.h",
    ],
    hdrs = [
        "cpu_utils.h",
    ],
    copts = tf_copts(),
    deps = [
        "//tensorflow/core/platform:logging",
        "//tensorflow/core/platform:macros",
        "//tensorflow/core/platform:types",
        "@com_google_absl//absl/base",
        "@xla//xla/tsl/platform:macros",
        "@xla//xla/tsl/platform:types",
        "@xla//xla/tsl/platform/profile_utils:profile_utils_cpu_utils",
    ],
    alwayslink = 1,
)
