debug tips

Q: What’s the code i40e_xmit_frame_ring+0x5667/0x5d50 related A: Please install debuginfo for the kernel that was running and provide the following output 1 2 # gdb /usr/lib/debug/usr/lib/modules/<yourkernel>/kernel/drivers/net/ethernet/intel/i40e/i40e.ko.debug (gdb) list *i40e_xmit_frame_ring+0x5667 But for buildin functions which don’t have .ko.debug file, just use vmlinux file, e.g. 1 2 # gdb /usr/lib/debug/lib/modules/<yourkernel>/vmlinux (gdb) list *icmp_rcv+0x193/0x3b0 Q: how to print pr_debug info A: Usually you should able to print it when DEBUG defined.

linux_tools

PDF unit 2 pdf file to 1 $ pdfunite input_1.pdf input_2.pdf output.pdf compress pdf $ convert -density 200 -compress jpeg input.pdf out.pdf

trace event

https://lwn.net/Articles/379903/ https://lwn.net/Articles/381064/ https://lwn.net/Articles/383362/ https://www.kernel.org/doc/html/v4.18/trace/events.html

tracing

Data source tracepoints: kernel static tracing kprobes: kernel dynamic tracing uprobes: user level dynamic tracing USDT / dtrace probes These tracepoints are hard coded in interesting and logical locations of the kernel, so that higher-level behavior can be easily traced. You can find all the tracepoints in include/trace/events/ Dynamic tracing can see everything, it’s also an unstable interface since it is instrumenting raw code. cBPF used for filter. eBPF has (key/value) maps and more helper functions.

podman

Podman Basic Usage: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 $ podman search rhel $ podman pull $server/rhel7:7.5 $ podman images $ podman run -d --name $node_name ubi7/ubi:7.7 echo 'Hello!' $ podman run -d --name $node_name -it -e VAR=hi rhel /bin/bash $ podman exec -it $node_name /bin/bash $ podman exec -it -l /bin/bash $ podman inspect -f '{{ .NetworkSettings.IPAddress }}' $node_name $ podman ps --format "{{.