Skip to content

Commit 342488a

Browse files
vincentmliKernel Patches Daemon
authored andcommitted
bpftool: add kernel.kptr_restrict hint for no instructions
from bpftool github repo issue [0], when Linux distribution kernel.kptr_restrict is set to 2, bpftool prog dump jited returns "no instructions returned", this message can be puzzling to bpftool users who is not familiar with kernel BPF internal, so add small hint for bpftool users to check kernel.kptr_restrict setting. Set kernel.kptr_restrict to expose kernel address to allow bpftool prog dump jited to dump the jited bpf program instructions. [0]: libbpf/bpftool#184 Signed-off-by: Vincent Li <[email protected].
1 parent 61c9cef commit 342488a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/bpf/bpftool/prog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ prog_dump(struct bpf_prog_info *info, enum dump_mode mode,
714714

715715
if (mode == DUMP_JITED) {
716716
if (info->jited_prog_len == 0 || !info->jited_prog_insns) {
717-
p_info("no instructions returned");
717+
p_info("no instructions returned: set kernel.kptr_restrict to expose kernel addresses");
718718
return -1;
719719
}
720720
buf = u64_to_ptr(info->jited_prog_insns);

0 commit comments

Comments
 (0)