File tree Expand file tree Collapse file tree
agent/src/ebpf/samples/rust/socket-tracer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,3 +21,5 @@ lazy_static = "1.4.0"
2121log = " 0.4"
2222env_logger = " 0.9"
2323trace-utils = { path = " ../../../../../crates/trace-utils" }
24+ # Enable this option when building the Enterprise edition.
25+ # trace-utils-interp = { path = "../../../../../crates/trace-utils-interp" }
Original file line number Diff line number Diff line change @@ -28,6 +28,21 @@ use std::thread;
2828use std:: time:: { Duration , UNIX_EPOCH } ;
2929use log:: info;
3030
31+ // Reference trace-utils-interp when building the Enterprise edition.
32+ // The purpose is to ensure that Rust links against libtrace_utils_interp-xxxx.rlib
33+ // during the linking stage.
34+ //
35+ // interpreter_tracer.c calls is_php_process(),
36+ // and this function is defined in the trace-utils-interp crate.
37+ //
38+ // However, the Rust code in socket_tracer does not directly reference
39+ // trace-utils-interp. As a result, Cargo considers this dependency unused
40+ // and excludes it from the linking stage.
41+ //
42+ // Therefore, we explicitly reference trace-utils-interp here to force
43+ // Cargo to include it in the final link.
44+ //use trace_utils_interp as _;
45+
3146extern "C" {
3247 fn print_uprobe_http2_info ( data : * mut c_char , len : c_uint ) ;
3348 fn print_uprobe_grpc_dataframe ( data : * mut c_char , len : c_uint ) ;
You can’t perform that action at this time.
0 commit comments