android_kernel_motorola_sm6225/tools
Daniel Borkmann fd981e3c32 filter: bpf_dbg: add minimal bpf debugger
This patch adds a minimal BPF debugger that "emulates" the kernel's
BPF engine (w/o extensions) and allows for single stepping (forwards
and backwards through BPF code) or running with >=1 breakpoints through
selected or all packets from a pcap file with a provided user filter
in order to facilitate verification of a BPF program. When a breakpoint
is being hit, it dumps all register contents, decoded instructions and
in case of branches both decoded branch targets as well as other useful
information.

Having this facility is in particular useful to verify BPF programs
against given test traffic *before* attaching to a live system.

With the general availability of cls_bpf, xt_bpf, socket filters,
team driver and e.g. PTP code, all BPF users, quite often a single
more complex BPF program is being used. Reasons for a more complex
BPF program are primarily to optimize execution time for making a
verdict when multiple simple BPF programs are combined into one in
order to prevent parsing same headers multiple times. In particular,
for cls_bpf that can have various return paths for encoding flowids,
and xt_bpf to come to a fw verdict this can be the case.

Therefore, as this can result in more complex and harder to debug
code, it would be very useful to have this minimal tool for testing
purposes. It can also be of help for BPF JIT developers as filters
are "test attached" to the kernel on a temporary socket thus
triggering a JIT image dump when enabled. The tool uses an interactive
libreadline shell with auto-completion and history support.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-11 20:28:35 -05:00
..
cgroup cgroups: fix cgroup_event_listener error handling 2013-01-08 10:00:44 -08:00
firewire tools/firewire: nosy-dump: check for allocation failure 2012-12-02 20:10:18 +01:00
hv Tools: hv: use single send+recv buffer 2013-09-26 12:03:31 -07:00
include/tools tools/include: use stdint types for user-space byteshift headers 2013-07-03 16:02:28 +02:00
lguest tools/lguest: offer VIRTIO_F_ANY_LAYOUT for net device. 2013-07-15 11:18:32 +09:30
lib tools lib traceevent: Fix conversion of pointer to integer of different size 2013-11-19 16:37:59 -03:00
net filter: bpf_dbg: add minimal bpf debugger 2013-12-11 20:28:35 -05:00
nfsd NFSD: Added fault injection script 2011-11-07 21:10:47 -05:00
perf perf header: Fix possible memory leaks in process_group_desc() 2013-11-19 10:34:05 -03:00
power tools: cpupower: fix wrong err msg not supported vs not available 2013-11-25 23:10:50 +01:00
scripts tools: Harmonize the various build messages in perf, lib-traceevent, lib-lk 2013-10-11 12:18:08 -03:00
testing H8/300 has been dead for several years, the kernel for it has 2013-11-12 14:13:14 +09:00
thermal/tmon tools/thermal: Introduce tmon, a tool for thermal subsystem 2013-11-07 08:45:34 +08:00
usb tools: usb: ffs-test: Fix build failure 2013-03-07 12:23:17 +08:00
virtio virtio_test: verify if virtqueue_kick() succeeded 2013-10-29 11:28:16 +10:30
vm tools/vm/page-types.c: support KPF_SOFTDIRTY bit 2013-11-13 12:09:07 +09:00
Makefile tools/thermal: Introduce tmon, a tool for thermal subsystem 2013-11-07 08:45:34 +08:00