Logo
Explore Help
Sign In
mirror/xdp-project-bpf-examples
1
0
Fork 0
You've already forked xdp-project-bpf-examples
mirror of https://github.com/xdp-project/bpf-examples.git synced 2024-05-06 15:54:53 +00:00
Code Issues Projects Releases Wiki Activity
Files
configure-fixes
xdp-project-bpf-examples/pkt-loop-filter/read-debug-output.sh

14 lines
300 B
Bash
Raw Permalink Normal View History

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-28 16:18:09 +02:00
#!/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
Reference in New Issue Copy Permalink
Powered by Gitea Page: 213ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API