Skip to content

Commit

Permalink
bpf/unwinders/go_traceid.h: Fix Go 1.22 labels offset (#2589)
Browse files Browse the repository at this point in the history
  • Loading branch information
brancz committed Mar 4, 2024
1 parent 580aec0 commit da59a7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bpf/unwinders/go_traceid.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,13 @@ static __always_inline bool get_trace_id(unsigned char *res_trace_id) {

// DW_TAG_member
// DW_AT_name ("labels")
// DW_AT_data_member_location (360)
// DW_AT_data_member_location (344)
// DW_AT_type (0x000000000005c242 "void *")
// DW_AT_GO_embedded_field (0x00)
//
// TODO: This was 360 in Go 1.20, but 344 in 1.22, we should set the offsets dynamically
void *labels_map_ptr_ptr;
res = bpf_probe_read_user(&labels_map_ptr_ptr, sizeof(void *), (void*)(curg_ptr_addr+360));
res = bpf_probe_read_user(&labels_map_ptr_ptr, sizeof(void *), (void*)(curg_ptr_addr+344));
if (res < 0) {
return false;
}
Expand Down

0 comments on commit da59a7c

Please sign in to comment.