diff options
| author | Martin KaFai Lau <[email protected]> | 2018-12-06 01:35:47 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2018-12-06 02:48:40 +0000 |
| commit | 84ecc1f98ca7ce28ede9bc5cc70a557fdfa09caa (patch) | |
| tree | d1b34c120c66dd799428ca4e61bf8ed710f4ae3e /tools/bpf/bpftool/prog.c | |
| parent | bpf: tools: Sync uapi bpf.h for the name changes in bpf_func_info (diff) | |
| download | kernel-84ecc1f98ca7ce28ede9bc5cc70a557fdfa09caa.tar.gz kernel-84ecc1f98ca7ce28ede9bc5cc70a557fdfa09caa.zip | |
bpf: Expect !info.func_info and insn_off name changes in test_btf/libbpf/bpftool
Similar to info.jited_*, info.func_info could be 0 if
bpf_dump_raw_ok() == false.
This patch makes changes to test_btf and bpftool to expect info.func_info
could be 0.
This patch also makes the needed changes for s/insn_offset/insn_off/.
Signed-off-by: Martin KaFai Lau <[email protected]>
Acked-by: Yonghong Song <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
| -rw-r--r-- | tools/bpf/bpftool/prog.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index 54c8dbf05c9c..a9a51123454c 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c @@ -589,6 +589,13 @@ static int do_dump(int argc, char **argv) goto err_free; } + if (func_info && !info.func_info) { + /* kernel.kptr_restrict is set. No func_info available. */ + free(func_info); + func_info = NULL; + finfo_cnt = 0; + } + if ((member_len == &info.jited_prog_len && info.jited_prog_insns == 0) || (member_len == &info.xlated_prog_len && |
