Skip to content

Commit

Permalink
Separate "topology" into its own cc_library target.
Browse files Browse the repository at this point in the history
This lets us deprecate gratuitous dependencies on "ghost" when all that
was needed was "topology" (for e.g. see rpc_api).

No functional change.

PiperOrigin-RevId: 507542941
  • Loading branch information
neelnatu authored and dohyunkim-dev committed Mar 23, 2023
1 parent 7e886f5 commit b3c4a71
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
36 changes: 32 additions & 4 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ cc_library(
"lib/agent.cc",
"lib/channel.cc",
"lib/enclave.cc",
"lib/topology.cc",
],
hdrs = [
"bpf/user/agent.h",
Expand All @@ -57,7 +56,6 @@ cc_library(
"lib/channel.h",
"lib/enclave.h",
"lib/scheduler.h",
"lib/topology.h",
"//third_party:iovisor_bcc/trace_helpers.h",
],
copts = compiler_flags,
Expand All @@ -66,6 +64,7 @@ cc_library(
":base",
":ghost",
":shared",
":topology",
":trivial_status",
"@com_google_absl//absl/base:core_headers",
"@com_google_absl//absl/container:flat_hash_map",
Expand Down Expand Up @@ -103,6 +102,7 @@ cc_binary(
deps = [
":agent",
":base",
":topology",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/flags:parse",
Expand All @@ -127,6 +127,7 @@ cc_library(
deps = [
":agent",
":base",
":topology",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/flags:parse",
Expand All @@ -147,6 +148,7 @@ cc_binary(
deps = [
":agent",
":edf_scheduler",
":topology",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/flags:parse",
],
Expand Down Expand Up @@ -184,6 +186,7 @@ cc_binary(
deps = [
":agent",
":shinjuku_scheduler",
":topology",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/flags:parse",
],
Expand Down Expand Up @@ -214,6 +217,7 @@ cc_binary(
deps = [
":agent",
":sol_scheduler",
":topology",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/flags:parse",
],
Expand Down Expand Up @@ -255,6 +259,7 @@ cc_binary(
":base",
":cfs_scheduler",
":ghost",
":topology",
"@com_google_googletest//:gtest",
],
)
Expand Down Expand Up @@ -328,6 +333,24 @@ exports_files(glob([
"lib/queue.bpf.h",
])

cc_library(
name = "topology",
srcs = [
"lib/topology.cc",
],
hdrs = [
"lib/topology.h",
],
copts = compiler_flags,
linkopts = ["-lnuma"],
deps = [
":base",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/strings:str_format",
],
)

cc_library(
name = "base",
srcs = [
Expand Down Expand Up @@ -382,6 +405,7 @@ cc_binary(
deps = [
":agent",
":biff_scheduler",
":topology",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/flags:parse",
],
Expand Down Expand Up @@ -449,6 +473,7 @@ cc_binary(
deps = [
":agent",
":cfs_bpf_scheduler",
":topology",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/flags:parse",
],
Expand Down Expand Up @@ -671,6 +696,7 @@ cc_binary(
deps = [
":agent",
":fifo_centralized_scheduler",
":topology",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/flags:parse",
],
Expand Down Expand Up @@ -702,6 +728,7 @@ cc_binary(
deps = [
":agent",
":flux_scheduler",
":topology",
"@com_google_absl//absl/debugging:symbolize",
"@com_google_absl//absl/flags:parse",
],
Expand Down Expand Up @@ -753,17 +780,16 @@ cc_library(
name = "ghost",
srcs = [
"lib/ghost.cc",
"lib/topology.cc",
],
hdrs = [
"kernel/ghost_uapi.h",
"lib/ghost.h",
"lib/topology.h",
],
copts = compiler_flags,
linkopts = ["-lnuma"],
deps = [
":base",
":topology",
"@com_google_absl//absl/container:flat_hash_map",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/flags:flag",
Expand Down Expand Up @@ -844,6 +870,7 @@ cc_test(
deps = [
":agent",
":ghost",
":topology",
"@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/flags:flag",
"@com_google_absl//absl/flags:parse",
Expand Down Expand Up @@ -1277,6 +1304,7 @@ cc_test(
deps = [
":agent",
":ghost",
":topology",
"@com_google_benchmark//:benchmark",
"@com_google_googletest//:gtest",
],
Expand Down
1 change: 0 additions & 1 deletion lib/topology.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <thread>

#include "absl/strings/str_format.h"
#include "lib/ghost.h"
#include <numa.h>

namespace ghost {
Expand Down

0 comments on commit b3c4a71

Please sign in to comment.