@@ -141,7 +141,15 @@ static __inline int32_t get_fd_from_http2_Framer(const void* framer_ptr,
141141static __inline int32_t get_fd_from_http_http2Framer (const void * framer_ptr ,
142142 const struct go_http2_symaddrs_t * symaddrs ) {
143143 REQUIRE_SYMADDR (symaddrs -> http2Framer_w_offset , kInvalidFD );
144- REQUIRE_SYMADDR (symaddrs -> http2bufferedWriter_w_offset , kInvalidFD );
144+ int32_t inner_intf_offset = symaddrs -> http2bufferedWriter_w_offset ;
145+ bool conn_intf = false;
146+ // Go 1.24 dropped the io.Writer w member from http2bufferedWriter,
147+ // moving forward it uses a conn member (net.Conn interface) instead.
148+ if (inner_intf_offset == -1 ) {
149+ inner_intf_offset = symaddrs -> http2bufferedWriter_conn_offset ;
150+ REQUIRE_SYMADDR (inner_intf_offset , kInvalidFD );
151+ conn_intf = true;
152+ }
145153
146154 struct go_interface io_writer_interface ;
147155 BPF_PROBE_READ_VAR (io_writer_interface , framer_ptr + symaddrs -> http2Framer_w_offset );
@@ -152,11 +160,13 @@ static __inline int32_t get_fd_from_http_http2Framer(const void* framer_ptr,
152160 return kInvalidFD ;
153161 }
154162
155- struct go_interface inner_io_writer_interface ;
156- BPF_PROBE_READ_VAR (inner_io_writer_interface ,
157- io_writer_interface .ptr + symaddrs -> http2bufferedWriter_w_offset );
163+ struct go_interface inner_intf ;
164+ bpf_probe_read (& inner_intf , sizeof (inner_intf ), io_writer_interface .ptr + inner_intf_offset );
158165
159- return get_fd_from_io_writer_intf (inner_io_writer_interface .ptr );
166+ if (conn_intf ) {
167+ return get_fd_from_conn_intf (inner_intf );
168+ }
169+ return get_fd_from_io_writer_intf (inner_intf .ptr );
160170}
161171
162172//-----------------------------------------------------------------------------
@@ -525,7 +535,7 @@ int probe_http2_server_operate_headers(struct pt_regs* ctx) {
525535// Symbol:
526536// net/http.(*http2serverConn).processHeaders
527537//
528- // Verified to be stable from go1.?? to t go.1.13.
538+ // Verified to be stable from go1.?? to go.1.13.
529539int probe_http_http2serverConn_processHeaders (struct pt_regs * ctx ) {
530540 uint32_t tgid = bpf_get_current_pid_tgid () >> 32 ;
531541 struct go_http2_symaddrs_t * symaddrs = http2_symaddrs_map .lookup (& tgid );
@@ -629,7 +639,7 @@ int probe_http_http2serverConn_processHeaders(struct pt_regs* ctx) {
629639// Symbol:
630640// golang.org/x/net/http2/hpack.(*Encoder).WriteField
631641//
632- // Verified to be stable from at least go1.6 to t go.1.13.
642+ // Verified to be stable from at least go1.6 to go.1.13.
633643int probe_hpack_header_encoder (struct pt_regs * ctx ) {
634644 uint32_t tgid = bpf_get_current_pid_tgid () >> 32 ;
635645 struct go_http2_symaddrs_t * symaddrs = http2_symaddrs_map .lookup (& tgid );
@@ -679,7 +689,7 @@ int probe_hpack_header_encoder(struct pt_regs* ctx) {
679689// Symbol:
680690// net/http.(*http2writeResHeaders).writeFrame
681691//
682- // Verified to be stable from go1.?? to t go.1.13.
692+ // Verified to be stable from go1.?? to go.1.13.
683693int probe_http_http2writeResHeaders_write_frame (struct pt_regs * ctx ) {
684694 uint32_t tgid = bpf_get_current_pid_tgid () >> 32 ;
685695 struct go_http2_symaddrs_t * symaddrs = http2_symaddrs_map .lookup (& tgid );
@@ -857,7 +867,7 @@ static __inline void go_http2_submit_data(struct pt_regs* ctx, enum http2_probe_
857867// Symbol:
858868// golang.org/x/net/http2.(*Framer).checkFrameOrder
859869//
860- // Verified to be stable from at least go1.6 to t go.1.13.
870+ // Verified to be stable from at least go1.6 to go.1.13.
861871int probe_http2_framer_check_frame_order (struct pt_regs * ctx ) {
862872 uint32_t tgid = bpf_get_current_pid_tgid () >> 32 ;
863873 struct go_http2_symaddrs_t * symaddrs = http2_symaddrs_map .lookup (& tgid );
@@ -1066,7 +1076,7 @@ int probe_http_http2framer_check_frame_order(struct pt_regs* ctx) {
10661076// Symbol:
10671077// golang.org/x/net/http2.(*Framer).WriteDataPadded
10681078//
1069- // Verified to be stable from go1.7 to t go.1.13.
1079+ // Verified to be stable from go1.7 to go.1.13.
10701080int probe_http2_framer_write_data (struct pt_regs * ctx ) {
10711081 uint32_t tgid = bpf_get_current_pid_tgid () >> 32 ;
10721082 struct go_http2_symaddrs_t * symaddrs = http2_symaddrs_map .lookup (& tgid );
@@ -1134,7 +1144,7 @@ int probe_http2_framer_write_data(struct pt_regs* ctx) {
11341144// Symbol:
11351145// net/http.(*http2Framer).WriteDataPadded
11361146//
1137- // Verified to be stable from go1.?? to t go.1.13 .
1147+ // Verified to be stable from go1.?? to go.1.23 .
11381148int probe_http_http2framer_write_data (struct pt_regs * ctx ) {
11391149 uint32_t tgid = bpf_get_current_pid_tgid () >> 32 ;
11401150 struct go_http2_symaddrs_t * symaddrs = http2_symaddrs_map .lookup (& tgid );
0 commit comments