-
Notifications
You must be signed in to change notification settings - Fork 498
Expand file tree
/
Copy pathBUILD.bazel
More file actions
112 lines (102 loc) · 4.25 KB
/
BUILD.bazel
File metadata and controls
112 lines (102 loc) · 4.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Copyright 2018- The Pixie Authors.
#
# 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.
#
# SPDX-License-Identifier: Apache-2.0
load("@io_bazel_rules_docker//container:container.bzl", "container_layer")
load("//bazel:linux_headers.bzl", "gen_timeconst")
load("//bazel:pl_build_system.bzl", "pl_cc_library")
package(default_visibility = [
"//src/stirling:__subpackages__",
])
pl_cc_library(
name = "cc_library",
srcs = glob(
["*.cc"],
exclude = [
"**/*_test.cc",
],
),
hdrs = glob(
["*.h"],
exclude = [
"**/*_mock.h",
],
),
visibility = [
"//src/e2e_test/vizier/planner/dump_schemas:__pkg__",
"//src/experimental/standalone_pem:__subpackages__",
"//src/stirling:__subpackages__",
"//src/vizier/services/agent:__subpackages__",
],
deps = [
"//src/shared/types/typespb/wrapper:cc_library",
"//src/stirling/bpf_tools:cc_library",
"//src/stirling/core:cc_library",
"//src/stirling/proto:stirling_pl_cc_proto",
"//src/stirling/source_connectors/dynamic_bpftrace:cc_library",
"//src/stirling/source_connectors/dynamic_tracer:cc_library",
"//src/stirling/source_connectors/jvm_stats:cc_library",
"//src/stirling/source_connectors/network_stats:cc_library",
"//src/stirling/source_connectors/perf_profiler:cc_library",
"//src/stirling/source_connectors/pid_runtime:cc_library",
"//src/stirling/source_connectors/pid_runtime_bpftrace:cc_library",
"//src/stirling/source_connectors/proc_exit:cc_library",
"//src/stirling/source_connectors/proc_stat:cc_library",
"//src/stirling/source_connectors/process_stats:cc_library",
"//src/stirling/source_connectors/seq_gen:cc_library",
"//src/stirling/source_connectors/socket_tracer:cc_library",
"//src/stirling/source_connectors/stirling_error:cc_library",
"//src/stirling/source_connectors/tcp_stats:cc_library",
"//src/stirling/utils:cc_library",
],
)
# Used by stirling runtime to install linux headers on hosts having no Linux headers pre-installed.
#
# Note that each linux header tarball is ~15MB compressed and ~230MB uncompressed.
# Trimmed versions are ~8-11MB (8.6 MB avg) compressed and ~45MB uncompressed.
# These are all trimmed versions, so we have 9MB * 29 = ~250 MB of headers.
stirling_linux_headers_tarballs = select({
"@platforms//cpu:aarch64": ["@linux_headers_merged_arm64_tar_gz//file:file"],
"@platforms//cpu:x86_64": ["@linux_headers_merged_x86_64_tar_gz//file:file"],
})
# Used by stirling runtime to replace the on-the-fly installed Linux headers from
# stirling_linux_headers_tarballs, in order to match the host's actual configs.
#
# See GenTimeConst() in src/stirling/utils/linux_headers.h for more details.
gen_timeconst(name = "stirling_linux_timeconst_files")
# Used by stirling runtime to provide symbolization for Java application profiling.
stirling_java_profiling_tools = [
"//src/stirling/source_connectors/perf_profiler/java/px_jattach:px_jattach",
"//src/stirling/source_connectors/perf_profiler/java/agent:agent",
]
# Use this binary to dynamically turn on/off Stirling runtime's debug logging.
# See src/stirling/e2e_tests/stirling_signal_test.sh for its usage.
stirling_ctrl = [
"//src/stirling/binaries:stirling_ctrl",
]
stirling_collateral = [":stirling_linux_timeconst_files"] + stirling_ctrl + stirling_java_profiling_tools
filegroup(
name = "offsetgen_offsets",
srcs = [
"offsetgen_offsets.json",
],
visibility = ["//visibility:public"],
)
container_layer(
name = "bpf_layer",
directory = "/px",
files = stirling_collateral,
tars = stirling_linux_headers_tarballs,
visibility = ["//visibility:public"],
)