Skip to content

Commit

Permalink
eBPF tracer: fix the connection timestamp lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
def committed Nov 30, 2022
1 parent f4a8338 commit 97a7eec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ebpftracer/ebpf.go

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion ebpftracer/ebpf/l7/l7.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ int trace_exit_read(struct trace_event_raw_sys_exit_rw__stub* ctx) {
return 0;
}
e.duration = bpf_ktime_get_ns() - ns;
__u64 *timestamp = bpf_map_lookup_elem(&connection_timestamps, &k);
struct sk_info sk = {};
sk.pid = k.pid;
sk.fd = k.fd;
__u64 *timestamp = bpf_map_lookup_elem(&connection_timestamps, &sk);
if (timestamp) {
e.connection_timestamp = *timestamp;
}
Expand Down

0 comments on commit 97a7eec

Please sign in to comment.