Skip to content

Commit

Permalink
Make verifier happy on older linux
Browse files Browse the repository at this point in the history
  • Loading branch information
grcevski committed Jan 30, 2024
1 parent 63bc537 commit 429e057
Show file tree
Hide file tree
Showing 22 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions bpf/go_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ static __always_inline void tp_from_parent(tp_info_t *tp, tp_info_t *parent) {
tp->flags = parent->flags;
}

static __always_inline void tp_clone(tp_info_t *dest, tp_info_t *src) {
*((u64 *)dest->trace_id) = *((u64 *)src->trace_id);
*((u64 *)(dest->trace_id + 8)) = *((u64 *)(src->trace_id + 8));
*((u64 *)dest->span_id) = *((u64 *)src->span_id);
*((u64 *)dest->parent_id) = *((u64 *)src->parent_id);
dest->flags = src->flags;
}

static __always_inline void server_trace_parent(void *goroutine_addr, tp_info_t *tp, void *req_header) {
// May get overriden when decoding existing traceparent, but otherwise we set sample ON
tp->flags = 1;
Expand Down
4 changes: 2 additions & 2 deletions bpf/go_nethttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,9 @@ int uprobe_persistConnRoundTrip(struct pt_regs *ctx) {
tp_info_pid_t tp_p = {
.pid = pid,
.valid = 1,
.tp = invocation->tp
};


tp_clone(&tp_p.tp, &invocation->tp);
tp_p.tp.ts = bpf_ktime_get_ns();
bpf_dbg_printk("storing trace_map info for black-box tracing");
bpf_map_update_elem(&trace_map, &conn, &tp_p, BPF_ANY);
Expand Down
Binary file modified pkg/internal/ebpf/gosql/bpf_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/gosql/bpf_bpfel_x86.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/gosql/bpf_debug_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/gosql/bpf_debug_bpfel_x86.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/grpc/bpf_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/grpc/bpf_bpfel_x86.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/grpc/bpf_debug_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/grpc/bpf_debug_bpfel_x86.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/grpc/bpf_tp_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/grpc/bpf_tp_bpfel_x86.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/grpc/bpf_tp_debug_bpfel_x86.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/nethttp/bpf_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/nethttp/bpf_bpfel_x86.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/nethttp/bpf_debug_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/nethttp/bpf_debug_bpfel_x86.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/nethttp/bpf_tp_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/nethttp/bpf_tp_bpfel_x86.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_arm64.o
Binary file not shown.
Binary file modified pkg/internal/ebpf/nethttp/bpf_tp_debug_bpfel_x86.o
Binary file not shown.

0 comments on commit 429e057

Please sign in to comment.