diff options
| author | Paul Chaignon <paul.chaignon@gmail.com> | 2023-10-12 16:12:36 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2023-10-16 15:57:22 +0000 |
| commit | f207cf3a9909835b51338b0ba481725a72becdbc (patch) | |
| tree | 5a2f8159294fbb4eecea7500f39bf3fb774a6a04 /sys/linux | |
| parent | 8e4e71ae23a4d19c024f959445d207d06a795f56 (diff) | |
sys/linux/test: test case for bpf_trace_printk description
This commit adds a new test case for the bpf_trace_printk description
introduced in the previous commit. It corresponds to the code:
bpf_trace_printk("%d ", 8, 0x1234);
exit 0;
in a BPF program that is then executed via BPF_PROG_TEST_RUN.
Signed-off-by: Paul Chaignon <paul.chaignon@gmail.com>
Diffstat (limited to 'sys/linux')
| -rw-r--r-- | sys/linux/test/bpf_helpers | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/linux/test/bpf_helpers b/sys/linux/test/bpf_helpers new file mode 100644 index 000000000..9e65ffc55 --- /dev/null +++ b/sys/linux/test/bpf_helpers @@ -0,0 +1,5 @@ +# Load and execute a BPF program that simply calls bpf_trace_printk + +r1 = bpf$PROG_LOAD(AUTO, &AUTO={0x3, AUTO, &AUTO=@framed={{AUTO, AUTO, AUTO, AUTO, 0x0, AUTO, AUTO, AUTO, 0x0}, [@printk={@integer={AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, AUTO}, {AUTO, AUTO, AUTO, AUTO, AUTO, AUTO, 0x1234}, {AUTO, AUTO, AUTO, AUTO}}], {AUTO, AUTO, AUTO, AUTO}}, &AUTO='GPL\x00', 0x0, 0x0, 0x0, 0x0, 0x0, "00000000000000000000000000000000", 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, 0xa0) + +r2 = bpf$BPF_PROG_TEST_RUN(AUTO, &AUTO={r1, AUTO, 0x10, 0x10, &AUTO="0000000000000000", &AUTO="0000000000000000", 0x1, AUTO, 0x0, 0x0, 0x0, 0x0, 0x0, AUTO, 0x0}, 0x4c) |
