Skip to content
Draft
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
8 changes: 8 additions & 0 deletions .arclint
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,16 @@
"(^src/stirling/bpf_tools/bcc_bpf/system-headers)",
"(^src/stirling/mysql/testing/.*\\.json$)",
"(^src/stirling/obj_tools/testdata/go/test_go_binary.go)",
"(^src/stirling/offsetgen_offsets.json$)",
"(^src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/main.go$)",
"(^src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/main.go$)",
"(^src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/main.go$)",
"(^src/stirling/testing/demo_apps/go_grpc_tls_pl/server/mod_info/go.mod$)",
"(^src/stirling/testing/demo_apps/go_grpc_tls_pl/server/mod_info/go.sum$)",
"(^src/stirling/testing/demo_apps/go_grpc_tls_pl/server/mod_info/server.go$)",
"(^src/stirling/testing/demo_apps/go_https/server/go.mod$)",
"(^src/stirling/testing/demo_apps/go_https/server/go.sum$)",
"(^src/stirling/testing/demo_apps/go_https/server/https_server.go$)",
"(^src/stirling/utils/testdata/config$)",
"(^src/ui/\\.pnp.*)",
"(^src/ui/\\.yarn/)",
Expand Down
13 changes: 13 additions & 0 deletions bazel/container_images.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -287,3 +287,16 @@ def stirling_test_images():
repository = "mongo",
digest = "sha256:19b2e5c91f92c7b18113a1501c5a5fe52b71a6c6d2a5232eeebb4f2abacae04a",
)

container_pull(
name = "golang_1_23_https_server_with_buildinfo",
digest = "sha256:84120192f05cc2d809360e8876eafafa9e08cc848c188e2be0112a8b3cd2ec19",
registry = "docker.io",
repository = "ddelnano/go_https_with_mod_info",
)
container_pull(
name = "go_1_23_grpc_server_with_mod_info",
digest = "sha256:a06b8f280a37e671f64a93d534ca35d0ac495f5f3b8adb6e623a765fc6e9a1f5",
registry = "docker.io",
repository = "ddelnano/go_1_23_grpc_server_with_mod_info",
)
8 changes: 8 additions & 0 deletions src/stirling/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ 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",
Expand Down
9 changes: 8 additions & 1 deletion src/stirling/binaries/go_binary_parse_profiling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
#include "src/stirling/source_connectors/socket_tracer/uprobe_symaddrs.h"

using px::StatusOr;
using px::stirling::GoOffsetLocator;
using px::stirling::PopulateGoTLSDebugSymbols;
using px::stirling::obj_tools::DwarfReader;
using px::stirling::obj_tools::ElfReader;
using px::stirling::obj_tools::ReadGoBuildInfo;

//-----------------------------------------------------------------------------
// This utility is designed to isolate parsing the debug symbols of a Go binary. This
Expand Down Expand Up @@ -62,8 +64,13 @@ int main(int argc, char** argv) {
}
std::unique_ptr<DwarfReader> dwarf_reader = dwarf_reader_status.ConsumeValueOrDie();

auto build_info_s = ReadGoBuildInfo(elf_reader.get());
const auto& [go_version, build_info] = build_info_s.ConsumeValueOrDie();
std::unique_ptr<GoOffsetLocator> go_offset_locator =
std::make_unique<GoOffsetLocator>(dwarf_reader.get(), build_info, go_version);

struct go_tls_symaddrs_t symaddrs;
auto status = PopulateGoTLSDebugSymbols(elf_reader.get(), dwarf_reader.get(), &symaddrs);
auto status = PopulateGoTLSDebugSymbols(go_offset_locator.get(), &symaddrs);

if (!status.ok()) {
LOG(ERROR) << absl::Substitute("debug symbol parsing failed with: $0", status.msg());
Expand Down
Loading
Loading