Files
xdp-project-bpf-examples/pkt-loop-filter/read-debug-output.sh
Toke Høiland-Jørgensen 6f47602582 pkt-loop-filter: Add optional debugging of dropped packets
Add a debug mode to pkt-loop-filter that outputs debug messages for every
dropped packet (with the reason it was dropped). Also add a small script to
read the kernel trace pipe, after making sure tracing is active (otherwise
there will be no output in the pipe).

The source MAC address+VLAN is squeezed into a single u64 when printing as
a quick workaround to the lack of MAC address printing in BPF printk.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2022-06-29 16:58:34 +02:00

14 lines
300 B
Bash
Executable File

#!/bin/sh
set -o errexit
TRACE_ACTIVE=$(cat /sys/kernel/debug/tracing/tracing_on)
if [ "$TRACE_ACTIVE" -ne "1" ]; then
echo "Kernel tracing disabled, enabling"
echo 1 > /sys/kernel/debug/tracing/tracing_on
fi
echo "Reading trace pipe, ^C to exit"
cat /sys/kernel/debug/tracing/trace_pipe