xref: /aosp_15_r20/external/federated-compute/fcp/tracing/BUILD (revision 14675a029014e728ec732f129a32e299b2da0601)
1*14675a02SAndroid Build Coastguard Worker# Copyright 2019 Google LLC
2*14675a02SAndroid Build Coastguard Worker#
3*14675a02SAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License");
4*14675a02SAndroid Build Coastguard Worker# you may not use this file except in compliance with the License.
5*14675a02SAndroid Build Coastguard Worker# You may obtain a copy of the License at
6*14675a02SAndroid Build Coastguard Worker#
7*14675a02SAndroid Build Coastguard Worker#      http://www.apache.org/licenses/LICENSE-2.0
8*14675a02SAndroid Build Coastguard Worker#
9*14675a02SAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software
10*14675a02SAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS,
11*14675a02SAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12*14675a02SAndroid Build Coastguard Worker# See the License for the specific language governing permissions and
13*14675a02SAndroid Build Coastguard Worker# limitations under the License.
14*14675a02SAndroid Build Coastguard Worker
15*14675a02SAndroid Build Coastguard Workerload("@flatbuffers//:build_defs.bzl", "flatbuffer_cc_library")
16*14675a02SAndroid Build Coastguard Workerload("//fcp:config.bzl", "FCP_COPTS")
17*14675a02SAndroid Build Coastguard Worker
18*14675a02SAndroid Build Coastguard Workerpackage(
19*14675a02SAndroid Build Coastguard Worker    default_visibility = ["//fcp:internal"],
20*14675a02SAndroid Build Coastguard Worker    licenses = ["notice"],  # Apache 2.0
21*14675a02SAndroid Build Coastguard Worker)
22*14675a02SAndroid Build Coastguard Worker
23*14675a02SAndroid Build Coastguard Workerexports_files([
24*14675a02SAndroid Build Coastguard Worker    "tracing_schema_common.fbs",
25*14675a02SAndroid Build Coastguard Worker    "tracing_severity.h",
26*14675a02SAndroid Build Coastguard Worker    "tracing_tag.h",
27*14675a02SAndroid Build Coastguard Worker    "tracing_traits.h",
28*14675a02SAndroid Build Coastguard Worker])
29*14675a02SAndroid Build Coastguard Worker
30*14675a02SAndroid Build Coastguard Workerflatbuffer_cc_library(
31*14675a02SAndroid Build Coastguard Worker    name = "tracing_schema_common",
32*14675a02SAndroid Build Coastguard Worker    srcs = ["tracing_schema_common.fbs"],
33*14675a02SAndroid Build Coastguard Worker    srcs_filegroup_name = "tracing_schema_common_fbs",
34*14675a02SAndroid Build Coastguard Worker)
35*14675a02SAndroid Build Coastguard Worker
36*14675a02SAndroid Build Coastguard Workercc_library(
37*14675a02SAndroid Build Coastguard Worker    name = "tracing",
38*14675a02SAndroid Build Coastguard Worker    srcs = [
39*14675a02SAndroid Build Coastguard Worker        "text_tracing_recorder_impl.cc",
40*14675a02SAndroid Build Coastguard Worker        "text_tracing_span_impl.cc",
41*14675a02SAndroid Build Coastguard Worker        "tracing_recorder_impl.cc",
42*14675a02SAndroid Build Coastguard Worker        "tracing_span_id.cc",
43*14675a02SAndroid Build Coastguard Worker        "tracing_span_impl.cc",
44*14675a02SAndroid Build Coastguard Worker        "tracing_span_ref.cc",
45*14675a02SAndroid Build Coastguard Worker        "tracing_traits.cc",
46*14675a02SAndroid Build Coastguard Worker    ],
47*14675a02SAndroid Build Coastguard Worker    hdrs = [
48*14675a02SAndroid Build Coastguard Worker        "scoped_tracing_recorder.h",
49*14675a02SAndroid Build Coastguard Worker        "text_tracing_recorder.h",
50*14675a02SAndroid Build Coastguard Worker        "text_tracing_recorder_impl.h",
51*14675a02SAndroid Build Coastguard Worker        "text_tracing_span_impl.h",
52*14675a02SAndroid Build Coastguard Worker        "tracing_recorder.h",
53*14675a02SAndroid Build Coastguard Worker        "tracing_recorder_impl.h",
54*14675a02SAndroid Build Coastguard Worker        "tracing_span.h",
55*14675a02SAndroid Build Coastguard Worker        "tracing_span_id.h",
56*14675a02SAndroid Build Coastguard Worker        "tracing_span_impl.h",
57*14675a02SAndroid Build Coastguard Worker        "tracing_span_ref.h",
58*14675a02SAndroid Build Coastguard Worker        "tracing_tag.h",
59*14675a02SAndroid Build Coastguard Worker        "tracing_traits.h",
60*14675a02SAndroid Build Coastguard Worker    ],
61*14675a02SAndroid Build Coastguard Worker    copts = FCP_COPTS,
62*14675a02SAndroid Build Coastguard Worker    deps = [
63*14675a02SAndroid Build Coastguard Worker        ":tracing_severity",
64*14675a02SAndroid Build Coastguard Worker        "//fcp/base",
65*14675a02SAndroid Build Coastguard Worker        "//fcp/base:error",
66*14675a02SAndroid Build Coastguard Worker        "@com_google_absl//absl/base:core_headers",
67*14675a02SAndroid Build Coastguard Worker        "@com_google_absl//absl/container:flat_hash_map",
68*14675a02SAndroid Build Coastguard Worker        "@com_google_absl//absl/synchronization",
69*14675a02SAndroid Build Coastguard Worker        "@com_google_absl//absl/time",
70*14675a02SAndroid Build Coastguard Worker        "@flatbuffers",
71*14675a02SAndroid Build Coastguard Worker    ],
72*14675a02SAndroid Build Coastguard Worker)
73*14675a02SAndroid Build Coastguard Worker
74*14675a02SAndroid Build Coastguard Workercc_library(
75*14675a02SAndroid Build Coastguard Worker    name = "test_tracing_recorder",
76*14675a02SAndroid Build Coastguard Worker    testonly = True,
77*14675a02SAndroid Build Coastguard Worker    srcs = [
78*14675a02SAndroid Build Coastguard Worker        "test_tracing_recorder.cc",
79*14675a02SAndroid Build Coastguard Worker        "test_tracing_recorder_impl.cc",
80*14675a02SAndroid Build Coastguard Worker        "test_tracing_span_impl.cc",
81*14675a02SAndroid Build Coastguard Worker    ],
82*14675a02SAndroid Build Coastguard Worker    hdrs = [
83*14675a02SAndroid Build Coastguard Worker        "test_tracing_recorder.h",
84*14675a02SAndroid Build Coastguard Worker        "test_tracing_recorder_impl.h",
85*14675a02SAndroid Build Coastguard Worker        "test_tracing_span_impl.h",
86*14675a02SAndroid Build Coastguard Worker        "tracing_traits.h",
87*14675a02SAndroid Build Coastguard Worker    ],
88*14675a02SAndroid Build Coastguard Worker    copts = FCP_COPTS,
89*14675a02SAndroid Build Coastguard Worker    deps = [
90*14675a02SAndroid Build Coastguard Worker        ":tracing",
91*14675a02SAndroid Build Coastguard Worker        ":tracing_severity",
92*14675a02SAndroid Build Coastguard Worker        "//fcp/base:source_location",
93*14675a02SAndroid Build Coastguard Worker        "@com_google_absl//absl/base:core_headers",
94*14675a02SAndroid Build Coastguard Worker        "@com_google_absl//absl/container:flat_hash_map",
95*14675a02SAndroid Build Coastguard Worker        "@com_google_absl//absl/container:flat_hash_set",
96*14675a02SAndroid Build Coastguard Worker        "@com_google_absl//absl/synchronization",
97*14675a02SAndroid Build Coastguard Worker        "@com_google_googletest//:gtest_main",
98*14675a02SAndroid Build Coastguard Worker        "@flatbuffers",
99*14675a02SAndroid Build Coastguard Worker    ],
100*14675a02SAndroid Build Coastguard Worker)
101*14675a02SAndroid Build Coastguard Worker
102*14675a02SAndroid Build Coastguard Workercc_library(
103*14675a02SAndroid Build Coastguard Worker    name = "tracing_severity",
104*14675a02SAndroid Build Coastguard Worker    hdrs = ["tracing_severity.h"],
105*14675a02SAndroid Build Coastguard Worker)
106*14675a02SAndroid Build Coastguard Worker
107*14675a02SAndroid Build Coastguard Workercc_library(
108*14675a02SAndroid Build Coastguard Worker    name = "tracing_context_utils",
109*14675a02SAndroid Build Coastguard Worker    srcs = ["tracing_context_utils.cc"],
110*14675a02SAndroid Build Coastguard Worker    hdrs = ["tracing_context_utils.h"],
111*14675a02SAndroid Build Coastguard Worker    deps = [
112*14675a02SAndroid Build Coastguard Worker        ":tracing",
113*14675a02SAndroid Build Coastguard Worker        "//fcp/base",
114*14675a02SAndroid Build Coastguard Worker        "@com_google_protobuf//:protobuf",
115*14675a02SAndroid Build Coastguard Worker        "@flatbuffers",
116*14675a02SAndroid Build Coastguard Worker    ],
117*14675a02SAndroid Build Coastguard Worker)
118*14675a02SAndroid Build Coastguard Worker
119*14675a02SAndroid Build Coastguard Workercc_test(
120*14675a02SAndroid Build Coastguard Worker    name = "tracing_tag_test",
121*14675a02SAndroid Build Coastguard Worker    srcs = [
122*14675a02SAndroid Build Coastguard Worker        "tracing_tag_test.cc",
123*14675a02SAndroid Build Coastguard Worker    ],
124*14675a02SAndroid Build Coastguard Worker    copts = FCP_COPTS,
125*14675a02SAndroid Build Coastguard Worker    deps = [
126*14675a02SAndroid Build Coastguard Worker        ":tracing",
127*14675a02SAndroid Build Coastguard Worker        "@com_google_absl//absl/hash:hash_testing",
128*14675a02SAndroid Build Coastguard Worker        "@com_google_googletest//:gtest_main",
129*14675a02SAndroid Build Coastguard Worker    ],
130*14675a02SAndroid Build Coastguard Worker)
131