summaryrefslogtreecommitdiff
path: root/samples/bpf/lwt_len_hist_kern.c
diff options
context:
space:
mode:
authorDaniel T. Lee <danieltimlee@gmail.com>2023-01-15 10:16:06 +0300
committerAlexei Starovoitov <ast@kernel.org>2023-01-16 00:32:45 +0300
commitdac808c90749c7dddd91f01f1f4252d2518d5ea0 (patch)
treecefb81959c51b96493042c3fda40fd1dc0b8f897 /samples/bpf/lwt_len_hist_kern.c
parentf20f064e84eb9c9229a7044e30f9b99720a8c2ea (diff)
downloadlinux-dac808c90749c7dddd91f01f1f4252d2518d5ea0.tar.xz
samples/bpf: fix broken lightweight tunnel testing
The test_lwt_bpf is a script that tests the functionality of BPF through the output of the ftrace with bpf_trace_printk. Currently, this program is not operating normally for several reasons. First of all, this test script can't parse the ftrace results properly. GNU sed tries to be as greedy as possible when attempting pattern matching. Due to this, cutting metadata (such as timestamp) from the log entry of ftrace doesn't work properly, and also desired log isn't extracted properly. To make sed stripping clearer, 'nocontext-info' option with the ftrace has been used to remove metadata from the log. Also, instead of using unclear pattern matching, this commit specifies an explicit parse pattern. Also, unlike before when this test was introduced, the way bpf_trace_printk behaves has changed[1]. The previous bpf_trace_printk had to always have '\n' in order to print newline, but now that the bpf_trace_printk call includes newline by default, so '\n' is no longer needed. Lastly with the lwt ENCAP_BPF out, the context information with the sk_buff protocol is preserved. Therefore, this commit changes the previous test result from 'protocol 0' to 'protocol 8', which means ETH_P_IP. [1]: commit ac5a72ea5c89 ("bpf: Use dedicated bpf_trace_printk event instead of trace_printk()") Signed-off-by: Daniel T. Lee <danieltimlee@gmail.com> Link: https://lore.kernel.org/r/20230115071613.125791-4-danieltimlee@gmail.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'samples/bpf/lwt_len_hist_kern.c')
0 files changed, 0 insertions, 0 deletions