Skip to content
Merged
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
26 changes: 0 additions & 26 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -210,32 +210,6 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

gazelle_dependencies(go_sdk = "go_sdk")

# Download alternative go toolchains after all other dependencies, so that they aren't used by external dependencies.
go_download_sdk(
name = "go_sdk_1_18",
version = "1.18.10",
)

go_download_sdk(
name = "go_sdk_1_19",
version = "1.19.13",
)

go_download_sdk(
name = "go_sdk_1_20",
version = "1.20.14",
)

go_download_sdk(
name = "go_sdk_1_21",
version = "1.21.13",
)

go_download_sdk(
name = "go_sdk_1_22",
version = "1.22.12",
)

go_download_sdk(
name = "go_sdk_1_23",
version = "1.23.10",
Expand Down
80 changes: 80 additions & 0 deletions bazel/container_images.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,83 @@ def stirling_test_images():
repository = "mongo",
digest = "sha256:19b2e5c91f92c7b18113a1501c5a5fe52b71a6c6d2a5232eeebb4f2abacae04a",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_18_https_server_with_buildinfo",
repository = "golang_1_18_https_server_with_buildinfo",
digest = "sha256:d4468289a2a4f2520effc48dd8894c998867b6638953302ef4156983dbf6e4e5",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_19_https_server_with_buildinfo",
repository = "golang_1_19_https_server_with_buildinfo",
digest = "sha256:8a35dab46ccd9af53704f8c83a8d3b28bf142f8e038696b2ba30b7df1c46df73",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_20_https_server_with_buildinfo",
repository = "golang_1_20_https_server_with_buildinfo",
digest = "sha256:c21f14e2213f4d9826926eeb3a0e7c7445789539561b43981bbca3efafcad8d7",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_21_https_server_with_buildinfo",
repository = "golang_1_21_https_server_with_buildinfo",
digest = "sha256:abb4573171c0a46afd4c704d8bbd6d123f022c5ad0448869311b026d0586106b",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_22_https_server_with_buildinfo",
repository = "golang_1_22_https_server_with_buildinfo",
digest = "sha256:0f14818a1046dfdb7d5ac27e173d99e071219897a1d9969c8d7604acbd0d9541",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_18_grpc_server_with_buildinfo",
repository = "golang_1_18_grpc_server_with_buildinfo",
digest = "sha256:e59a94abb2c505f680829951161a0a0209de0d02307da951c5a76d7b84a72034",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_19_grpc_server_with_buildinfo",
repository = "golang_1_19_grpc_server_with_buildinfo",
digest = "sha256:88b1ae2096af629152a645f77b9c47dcac45dde95fb78376c6fdf1f7183a652b",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_20_grpc_server_with_buildinfo",
repository = "golang_1_20_grpc_server_with_buildinfo",
digest = "sha256:a35e24a44c53d6f984eb633bbb15e318374a61fa426ccc5e580d587ce7f6a788",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_21_grpc_server_with_buildinfo",
repository = "golang_1_21_grpc_server_with_buildinfo",
digest = "sha256:998654168565a7d4ed1c73edbafc48042879ac26581972a8ba23fe5a39e520f2",
)

# Tag: 1.0
# Arch: linux/amd64
_container_image(
name = "golang_1_22_grpc_server_with_buildinfo",
repository = "golang_1_22_grpc_server_with_buildinfo",
digest = "sha256:67adba5e8513670fa37bd042862e7844f26239e8d2997ed8c3b0aa527bc04cc3",
)
3 changes: 2 additions & 1 deletion bazel/pl_build_system.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ load("@rules_python//python:defs.bzl", "py_test")
load("//bazel:toolchain_transitions.bzl", "qemu_interactive_runner")

pl_boringcrypto_go_sdk = ["1.23.9"]
pl_supported_go_sdk_versions = ["1.18", "1.19", "1.20", "1.21", "1.22", "1.23", "1.24"]
pl_go_test_versions = ["1.18", "1.19", "1.20", "1.21", "1.22"]
pl_supported_go_sdk_versions = ["1.23", "1.24"]

# The last version in this list corresponds to the boringcrypto go sdk version.
pl_all_supported_go_sdk_versions = pl_supported_go_sdk_versions + pl_boringcrypto_go_sdk
Expand Down
4 changes: 2 additions & 2 deletions src/stirling/bpf_tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ pl_cc_bpf_test(
],
deps = [
":cc_library",
"//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_grpc_client_container",
"//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_19_grpc_server_container",
"//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_24_grpc_client_container",
"//src/stirling/source_connectors/socket_tracer/testing/container_images:go_1_24_grpc_server_container",
],
)
14 changes: 7 additions & 7 deletions src/stirling/bpf_tools/uprobe_extra_trigger_bpf_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "src/common/testing/testing.h"
#include "src/stirling/bpf_tools/bcc_wrapper.h"
#include "src/stirling/bpf_tools/macros.h"
#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_client_container.h"
#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_19_grpc_server_container.h"
#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_24_grpc_client_container.h"
#include "src/stirling/source_connectors/socket_tracer/testing/container_images/go_1_24_grpc_server_container.h"

namespace px {
namespace stirling {
Expand Down Expand Up @@ -55,10 +55,10 @@ TEST(BCCWrapper, DISABLED_UnexpectedExtraTrigger) {
BCCWrapperImpl bcc_wrapper;
ASSERT_OK(bcc_wrapper.InitBPFProgram(kBCCProgram));

::px::stirling::testing::Go1_19_GRPCServerContainer server1;
::px::stirling::testing::Go1_19_GRPCServerContainer server2;
::px::stirling::testing::Go1_19_GRPCClientContainer client1;
::px::stirling::testing::Go1_19_GRPCClientContainer client2;
::px::stirling::testing::Go1_24_GRPCServerContainer server1;
::px::stirling::testing::Go1_24_GRPCServerContainer server2;
::px::stirling::testing::Go1_24_GRPCClientContainer client1;
::px::stirling::testing::Go1_24_GRPCClientContainer client2;

// A Uprobe template for the GRPCServerContainer.
// Binary path is set later.
Expand All @@ -70,7 +70,7 @@ TEST(BCCWrapper, DISABLED_UnexpectedExtraTrigger) {
};

// A templated path to the server. We will replace $0 with the pid of the server instance.
const std::string kServerPath = "/proc/$0/root/golang_1_19_grpc_tls_server_binary";
const std::string kServerPath = "/proc/$0/root/golang_1_24_grpc_tls_server_binary";

// Run server 1 and attach uprobes to it.
ASSERT_OK(server1.Run(std::chrono::seconds{60}));
Expand Down
16 changes: 8 additions & 8 deletions src/stirling/e2e_tests/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ pl_sh_bpf_test(
srcs = ["stirling_wrapper_bpf_test.sh"],
args = [
"$(location //src/stirling/binaries:stirling_wrapper)",
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs)",
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client)",
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs)",
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client)",
"-stirling_profiler_java_agent_libs %s" % agent_libs_arg,
],
data = [
"//src/stirling/binaries:stirling_wrapper",
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client",
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs",
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client",
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs",
] + agent_libs,
# TODO(PL-1462): Uprobe attaching sometimes fails.
flaky = True,
Expand Down Expand Up @@ -132,13 +132,13 @@ pl_sh_bpf_test(
srcs = ["stirling_wrapper_container_bpf_test.sh"],
args = [
"$(location //src/stirling/binaries:stirling_wrapper_image.tar)",
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs)",
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client)",
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs)",
"$(location //src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client)",
],
data = [
"//src/stirling/binaries:stirling_wrapper_image.tar",
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_19_grpc_client",
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_19_grpc_server_with_certs",
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client:golang_1_24_grpc_client",
"//src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server:golang_1_24_grpc_server_with_certs",
],
flaky = True,
tags = [
Expand Down
11 changes: 5 additions & 6 deletions src/stirling/obj_tools/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ pl_cc_test(
"//src/stirling/obj_tools/testdata/cc:stripped_exe",
"//src/stirling/obj_tools/testdata/cc:test_exe_debug_target",
"//src/stirling/obj_tools/testdata/cc:test_exe_debuglink_target",
"//src/stirling/obj_tools/testdata/go:test_go_1_19_binary",
"//src/stirling/obj_tools/testdata/go:test_go_1_19_nm_output",
"//src/stirling/obj_tools/testdata/go:test_go_1_24_binary",
"//src/stirling/obj_tools/testdata/go:test_go_1_24_nm_output",
],
deps = [
":cc_library",
Expand Down Expand Up @@ -89,7 +89,7 @@ pl_cc_test(
data = [
"//src/stirling/obj_tools/testdata/cc:test_exe_fixture",
"//src/stirling/obj_tools/testdata/go:test_binaries",
"//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_19_grpc_tls_server_binary",
"//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_24_grpc_tls_server_binary",
],
deps = [
":cc_library",
Expand Down Expand Up @@ -137,8 +137,7 @@ pl_cc_test(
"//src/stirling/obj_tools/testdata/go:test_binaries",
"//src/stirling/obj_tools/testdata/go:test_buildinfo_with_mods",
"//src/stirling/obj_tools/testdata/go:test_go_1_17_binary",
"//src/stirling/obj_tools/testdata/go:test_go_1_19_binary",
"//src/stirling/obj_tools/testdata/go:test_go_1_21_binary",
"//src/stirling/obj_tools/testdata/go:test_go_1_24_binary",
],
deps = [
":cc_library",
Expand Down Expand Up @@ -185,7 +184,7 @@ pl_cc_binary(
name = "dwarf_reader_benchmark",
testonly = 1,
srcs = ["dwarf_reader_benchmark.cc"],
data = ["//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_19_grpc_tls_server_binary"],
data = ["//src/stirling/testing/demo_apps/go_grpc_tls_pl/server:golang_1_24_grpc_tls_server_binary"],
deps = [
":cc_library",
"//src/common/testing:cc_library",
Expand Down
4 changes: 2 additions & 2 deletions src/stirling/obj_tools/dwarf_reader_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ using px::stirling::obj_tools::DwarfReader;
using px::testing::BazelRunfilePath;

constexpr std::string_view kBinary =
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_19_grpc_tls_server_binary_/"
"golang_1_19_grpc_tls_server_binary";
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_24_grpc_tls_server_binary_/"
"golang_1_24_grpc_tls_server_binary";

struct SymAddrs {
// Members of net/http.http2serverConn.
Expand Down
41 changes: 8 additions & 33 deletions src/stirling/obj_tools/dwarf_reader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,34 +24,19 @@
#include "src/common/testing/testing.h"
#include "src/stirling/utils/detect_application.h"

constexpr std::string_view kTestGo1_17Binary =
"src/stirling/obj_tools/testdata/go/test_go_1_17_binary";
constexpr std::string_view kTestGo1_18Binary =
"src/stirling/obj_tools/testdata/go/test_go_1_18_binary";
constexpr std::string_view kTestGo1_19Binary =
"src/stirling/obj_tools/testdata/go/test_go_1_19_binary";
constexpr std::string_view kTestGo1_20Binary =
"src/stirling/obj_tools/testdata/go/test_go_1_20_binary";
constexpr std::string_view kTestGo1_21Binary =
"src/stirling/obj_tools/testdata/go/test_go_1_21_binary";
constexpr std::string_view kTestGo1_22Binary =
"src/stirling/obj_tools/testdata/go/test_go_1_22_binary";
constexpr std::string_view kTestGo1_23Binary =
"src/stirling/obj_tools/testdata/go/test_go_1_23_binary";
constexpr std::string_view kTestGo1_24Binary =
"src/stirling/obj_tools/testdata/go/test_go_1_23_binary";
constexpr std::string_view kGoGRPCServer =
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_19_grpc_tls_server_binary";
"src/stirling/testing/demo_apps/go_grpc_tls_pl/server/golang_1_24_grpc_tls_server_binary";
constexpr std::string_view kCppBinary = "src/stirling/obj_tools/testdata/cc/test_exe_/test_exe";
constexpr std::string_view kGoBinaryUnconventional =
"src/stirling/obj_tools/testdata/go/sockshop_payments_service";

const auto kCPPBinaryPath = px::testing::BazelRunfilePath(kCppBinary);
const auto kGo1_17BinaryPath = px::testing::BazelRunfilePath(kTestGo1_17Binary);
const auto kGo1_18BinaryPath = px::testing::BazelRunfilePath(kTestGo1_18Binary);
const auto kGo1_19BinaryPath = px::testing::BazelRunfilePath(kTestGo1_19Binary);
const auto kGo1_20BinaryPath = px::testing::BazelRunfilePath(kTestGo1_20Binary);
const auto kGo1_21BinaryPath = px::testing::BazelRunfilePath(kTestGo1_21Binary);
const auto kGo1_22BinaryPath = px::testing::BazelRunfilePath(kTestGo1_22Binary);
const auto kGo1_23BinaryPath = px::testing::BazelRunfilePath(kTestGo1_23Binary);
const auto kGo1_24BinaryPath = px::testing::BazelRunfilePath(kTestGo1_24Binary);
const auto kGoServerBinaryPath = px::testing::BazelRunfilePath(kGoGRPCServer);
const auto kGoBinaryUnconventionalPath = px::testing::BazelRunfilePath(kGoBinaryUnconventional);

Expand Down Expand Up @@ -578,20 +563,10 @@ INSTANTIATE_TEST_SUITE_P(CppDwarfReaderParameterizedTest, CppDwarfReaderTest,
DwarfReaderTestParam{kCPPBinaryPath, false}));

INSTANTIATE_TEST_SUITE_P(GolangDwarfReaderParameterizedTest, GolangDwarfReaderTest,
::testing::Values(DwarfReaderTestParam{kGo1_17BinaryPath, true},
DwarfReaderTestParam{kGo1_17BinaryPath, false},
DwarfReaderTestParam{kGo1_18BinaryPath, true},
DwarfReaderTestParam{kGo1_18BinaryPath, false},
DwarfReaderTestParam{kGo1_19BinaryPath, true},
DwarfReaderTestParam{kGo1_19BinaryPath, false},
DwarfReaderTestParam{kGo1_20BinaryPath, true},
DwarfReaderTestParam{kGo1_20BinaryPath, false},
DwarfReaderTestParam{kGo1_21BinaryPath, true},
DwarfReaderTestParam{kGo1_21BinaryPath, false},
DwarfReaderTestParam{kGo1_22BinaryPath, true},
DwarfReaderTestParam{kGo1_22BinaryPath, false},
DwarfReaderTestParam{kGo1_23BinaryPath, true},
DwarfReaderTestParam{kGo1_23BinaryPath, false}));
::testing::Values(DwarfReaderTestParam{kGo1_23BinaryPath, true},
DwarfReaderTestParam{kGo1_23BinaryPath, false},
DwarfReaderTestParam{kGo1_24BinaryPath, true},
DwarfReaderTestParam{kGo1_24BinaryPath, false}));

INSTANTIATE_TEST_SUITE_P(GolangDwarfReaderParameterizedIndexTest, GolangDwarfReaderIndexTest,
::testing::Values(true, false));
Expand Down
4 changes: 2 additions & 2 deletions src/stirling/obj_tools/elf_reader_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ TEST(ElfReaderTest, FuncByteCode) {

TEST(ElfReaderTest, GolangAppRuntimeBuildVersion) {
const std::string kPath =
px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_19_binary");
px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_24_binary");
const std::string kGoBinNmOutput =
px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_19_nm_output");
px::testing::BazelRunfilePath("src/stirling/obj_tools/testdata/go/test_go_1_24_nm_output");
ASSERT_OK_AND_ASSIGN(std::unique_ptr<ElfReader> elf_reader, ElfReader::Create(kPath));
ASSERT_OK_AND_ASSIGN(ElfReader::SymbolInfo symbol,
elf_reader->SearchTheOnlySymbol("runtime.buildVersion"));
Expand Down
Loading
Loading