Skip to content

Commit

Permalink
Add timestamp/ethproto on observed interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
jotak committed Dec 20, 2024
1 parent abe0750 commit 9852c9b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bpf/flows.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ static inline int flow_monitor(struct __sk_buff *skb, u8 direction) {
if (extra_metrics != NULL) {
add_observed_intf(extra_metrics, skb->ifindex, direction);
} else {
additional_metrics new_metrics = {};
additional_metrics new_metrics = {
.eth_protocol = eth_protocol,
.start_mono_time_ts = pkt.current_ts,
.end_mono_time_ts = pkt.current_ts,
};
add_observed_intf(&new_metrics, skb->ifindex, direction);
long ret =
bpf_map_update_elem(&additional_flow_metrics, &id, &new_metrics, BPF_NOEXIST);
Expand Down
Binary file modified pkg/ebpf/bpf_arm64_bpfel.o
Binary file not shown.
Binary file modified pkg/ebpf/bpf_powerpc_bpfel.o
Binary file not shown.
Binary file modified pkg/ebpf/bpf_s390_bpfeb.o
Binary file not shown.
Binary file modified pkg/ebpf/bpf_x86_bpfel.o
Binary file not shown.

0 comments on commit 9852c9b

Please sign in to comment.