From e60264f30163b15b659d0c84a6a4c8e7edb7a0a3 Mon Sep 17 00:00:00 2001 From: Paul Chaignon Date: Mon, 27 Nov 2023 16:31:21 +0100 Subject: sys/linux: add all format specifiers for bpf_trace_printk The bpf_trace_printk helper supports a limited set of format specifiers [1]. This commit ensures they are all covered in the union. 1 - https://man7.org/linux/man-pages/man7/bpf-helpers.7.html Signed-off-by: Paul Chaignon --- sys/linux/bpf.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'sys/linux/bpf.txt') diff --git a/sys/linux/bpf.txt b/sys/linux/bpf.txt index a972af32d..9a6c4f498 100644 --- a/sys/linux/bpf.txt +++ b/sys/linux/bpf.txt @@ -700,11 +700,23 @@ type bpf_insn_null_check[REG] { exit bpf_insn_exit } +# Format specifiers for bpf_trace_printk, encoded as a zero-terminated string +# of 7 characters. For example, field 'p' corresponds to "%p ". type bpf_insn_mov_printk_str_hex[DST] [ -# "%p " - integer bpf_insn_mov_imm64[DST, 0x25702020, 0x20202000] -# "%d " - pointer bpf_insn_mov_imm64[DST, 0x25642020, 0x20202000] + p bpf_insn_mov_imm64[DST, 0x25702020, 0x20202000] + d bpf_insn_mov_imm64[DST, 0x25642020, 0x20202000] + i bpf_insn_mov_imm64[DST, 0x25692020, 0x20202000] + u bpf_insn_mov_imm64[DST, 0x25752020, 0x20202000] + x bpf_insn_mov_imm64[DST, 0x25782020, 0x20202000] + ld bpf_insn_mov_imm64[DST, 0x256c6420, 0x20202000] + li bpf_insn_mov_imm64[DST, 0x256c6920, 0x20202000] + lu bpf_insn_mov_imm64[DST, 0x256c7520, 0x20202000] + lx bpf_insn_mov_imm64[DST, 0x256c7820, 0x20202000] + lld bpf_insn_mov_imm64[DST, 0x256c6c64, 0x20202000] + lli bpf_insn_mov_imm64[DST, 0x256c6c69, 0x20202000] + llu bpf_insn_mov_imm64[DST, 0x256c6c75, 0x20202000] + llx bpf_insn_mov_imm64[DST, 0x256c6c78, 0x20202000] + s bpf_insn_mov_imm64[DST, 0x25732020, 0x20202000] ] # (18) r1 = "%d " -- cgit mrf-deployment