Skip to content

Commit

Permalink
Make userspace prog report the recorded latencies
Browse files Browse the repository at this point in the history
Add functionality to the user space component to periodically fetch
the BPF maps netstacklat records the values in and print them out.

Base the core program loop on the same setup as pping, where a single
epoll instance is used to support multiple different types of
events. So far it only deals with signal handling (for clean shutdown)
plus a timer (for periodical reporting), but the setup can easily be
extended if the program grows more complex in the future.

Use the (somewhat complicated) bpf_map_lookup_batch to fetch the
entire histogram maps in a single system call (instead of performing a
lookup for each bin index individually).

Signed-off-by: Simon Sundberg <[email protected]>
  • Loading branch information
simosund committed Jan 13, 2025
1 parent 5d8afb2 commit 36dd2e9
Show file tree
Hide file tree
Showing 2 changed files with 443 additions and 11 deletions.
1 change: 1 addition & 0 deletions netstacklat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ BPF_TARGETS := netstacklat.bpf
BPF_SKEL_OBJ := netstacklat.bpf.o

EXTRA_DEPS += netstacklat.h bits.bpf.h maps.bpf.h
LDLIBS += -lm

LIB_DIR = ../lib

Expand Down
Loading

0 comments on commit 36dd2e9

Please sign in to comment.