Skip to content

Commit bccddcd

Browse files
committed
Fix dynamic_tracing tests
Signed-off-by: Dom Del Nano <[email protected]>
1 parent 85c2bc9 commit bccddcd

File tree

3 files changed

+51
-12
lines changed

3 files changed

+51
-12
lines changed

src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/autogen_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "src/common/testing/testing.h"
2323
#include "src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/autogen.h"
2424

25-
constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_21_binary";
25+
constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_24_binary";
2626

2727
namespace px {
2828
namespace stirling {

src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dwarvifier_test.cc

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "src/common/testing/testing.h"
2323
#include "src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dwarvifier.h"
2424

25-
constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_21_binary";
25+
constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_24_binary";
2626
constexpr std::string_view kCPPBinaryPath = "src/stirling/obj_tools/testdata/cc/test_exe/test_exe";
2727

2828
namespace px {
@@ -1721,6 +1721,19 @@ structs {
17211721
path: "/len"
17221722
}
17231723
}
1724+
blob_decoders {
1725+
entries {
1726+
size: 8
1727+
type: VOID_POINTER
1728+
path: "/str"
1729+
}
1730+
entries {
1731+
offset: 8
1732+
size: 8
1733+
type: INT
1734+
path: "/len"
1735+
}
1736+
}
17241737
blob_decoders {
17251738
}
17261739
}
@@ -1807,21 +1820,28 @@ probes {
18071820
scalar_var {
18081821
name: "main__IntStruct_sym_addr1"
18091822
type: UINT64
1810-
constant: "4989632"
1823+
constant: "5103904"
18111824
}
18121825
}
18131826
vars {
18141827
scalar_var {
18151828
name: "runtime__errorString_sym_addr2"
18161829
type: UINT64
1817-
constant: "4989824"
1830+
constant: "5104192"
1831+
}
1832+
}
1833+
vars {
1834+
scalar_var {
1835+
name: "runtime__plainError_sym_addr3"
1836+
type: UINT64
1837+
constant: "5104224"
18181838
}
18191839
}
18201840
vars {
18211841
scalar_var {
1822-
name: "internal___poll__errNetClosing_sym_addr3"
1842+
name: "internal___poll__errNetClosing_sym_addr4"
18231843
type: UINT64
1824-
constant: "4989856"
1844+
constant: "5104256"
18251845
}
18261846
}
18271847
vars {
@@ -1896,7 +1916,7 @@ probes {
18961916
cond {
18971917
op: EQUAL
18981918
vars: "retval_intf_tab"
1899-
vars: "internal___poll__errNetClosing_sym_addr3"
1919+
vars: "runtime__plainError_sym_addr3"
19001920
}
19011921
vars {
19021922
scalar_var {
@@ -1911,6 +1931,25 @@ probes {
19111931
}
19121932
}
19131933
}
1934+
cond_blocks {
1935+
cond {
1936+
op: EQUAL
1937+
vars: "retval_intf_tab"
1938+
vars: "internal___poll__errNetClosing_sym_addr4"
1939+
}
1940+
vars {
1941+
scalar_var {
1942+
name: "retval"
1943+
type: STRUCT_BLOB
1944+
memory {
1945+
base: "retval_intf_data"
1946+
size: 16
1947+
decoder_idx: 4
1948+
op: ASSIGN_ONLY
1949+
}
1950+
}
1951+
}
1952+
}
19141953
}
19151954
language: GOLANG
19161955
arrays {

src/stirling/source_connectors/dynamic_tracer/dynamic_tracing/dynamic_tracer_test.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "src/common/testing/testing.h"
2727
#include "src/stirling/testing/common.h"
2828

29-
constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_21_binary";
29+
constexpr std::string_view kBinaryPath = "src/stirling/obj_tools/testdata/go/test_go_1_24_binary";
3030

3131
namespace px {
3232
namespace stirling {
@@ -45,15 +45,15 @@ using ::testing::SizeIs;
4545

4646
constexpr char kClientPath[] =
4747
"src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/"
48-
"golang_1_21_grpc_client";
48+
"golang_1_24_grpc_client";
4949

5050
constexpr char kClientPathExpected[] =
5151
"src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_client/"
5252
"client_/client";
5353

5454
constexpr char kServerPath[] =
5555
"src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/"
56-
"golang_1_21_grpc_server";
56+
"golang_1_24_grpc_server";
5757

5858
constexpr char kServerPathExpected[] =
5959
"src/stirling/source_connectors/socket_tracer/protocols/http2/testing/go_grpc_server/"
@@ -389,7 +389,7 @@ const std::vector<std::string> kExpectedBCC = {
389389
"void* goid_X_;",
390390
"bpf_probe_read(&goid_X_, sizeof(void*), parm__ + 0);",
391391
"uint64_t goid;",
392-
"bpf_probe_read(&goid, sizeof(uint64_t), goid_X_ + 152);",
392+
"bpf_probe_read(&goid, sizeof(uint64_t), goid_X_ + 160);",
393393
"uint32_t newval;",
394394
"bpf_probe_read(&newval, sizeof(uint32_t), parm__ + 16);",
395395
"struct pid_goid_map_value_t pid_goid_map_value = {};",
@@ -476,7 +476,7 @@ TEST(DynamicTracerTest, Compile) {
476476

477477
const auto& spec = bcc_program.uprobe_specs[0];
478478

479-
EXPECT_THAT(spec, Field(&UProbeSpec::binary_path, ::testing::EndsWith("test_go_1_21_binary")));
479+
EXPECT_THAT(spec, Field(&UProbeSpec::binary_path, ::testing::EndsWith("test_go_1_24_binary")));
480480
EXPECT_THAT(spec, Field(&UProbeSpec::symbol, "runtime.casgstatus"));
481481
EXPECT_THAT(spec, Field(&UProbeSpec::attach_type, bpf_tools::BPFProbeAttachType::kEntry));
482482
EXPECT_THAT(spec, Field(&UProbeSpec::probe_fn, "probe_entry_runtime_casgstatus"));

0 commit comments

Comments
 (0)