aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/lib/bpf
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2018-12-05 18:48:41 -0800
committerAlexei Starovoitov <ast@kernel.org>2018-12-05 18:48:41 -0800
commita06aef4ed5b6f1daa20babb4ad4458392bce5edd (patch)
treed1b34c120c66dd799428ca4e61bf8ed710f4ae3e /tools/lib/bpf
parenttools: bpftool: add a command to dump the trace pipe (diff)
parentbpf: Expect !info.func_info and insn_off name changes in test_btf/libbpf/bpftool (diff)
downloadwireguard-linux-a06aef4ed5b6f1daa20babb4ad4458392bce5edd.tar.xz
wireguard-linux-a06aef4ed5b6f1daa20babb4ad4458392bce5edd.zip
Merge branch 'bpf_func_info-improvements'
Martin KaFai Lau says: ==================== The patchset has a few improvements on bpf_func_info: 1. Improvements on the behaviors of info.func_info, info.func_info_cnt and info.func_info_rec_size. 2. Name change: s/insn_offset/insn_off/ Please see individual patch for details. ==================== Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/lib/bpf')
-rw-r--r--tools/lib/bpf/btf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index c2d641f3e16e..85d6446cf832 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -45,7 +45,7 @@ struct btf_ext {
/* The minimum bpf_func_info checked by the loader */
struct bpf_func_info_min {
- __u32 insn_offset;
+ __u32 insn_off;
__u32 type_id;
};
@@ -670,7 +670,7 @@ int btf_ext__reloc_init(struct btf *btf, struct btf_ext *btf_ext,
memcpy(data, sinfo->data, records_len);
- /* adjust the insn_offset, the data in .BTF.ext is
+ /* adjust the insn_off, the data in .BTF.ext is
* the actual byte offset, and the kernel expects
* the offset in term of bpf_insn.
*
@@ -681,7 +681,7 @@ int btf_ext__reloc_init(struct btf *btf, struct btf_ext *btf_ext,
struct bpf_func_info_min *record;
record = data + i * record_size;
- record->insn_offset /= sizeof(struct bpf_insn);
+ record->insn_off /= sizeof(struct bpf_insn);
}
*func_info = data;
@@ -722,15 +722,15 @@ int btf_ext__reloc(struct btf *btf, struct btf_ext *btf_ext,
return -ENOMEM;
memcpy(data + existing_flen, sinfo->data, records_len);
- /* adjust insn_offset only, the rest data will be passed
+ /* adjust insn_off only, the rest data will be passed
* to the kernel.
*/
for (i = 0; i < sinfo->num_func_info; i++) {
struct bpf_func_info_min *record;
record = data + existing_flen + i * record_size;
- record->insn_offset =
- record->insn_offset / sizeof(struct bpf_insn) +
+ record->insn_off =
+ record->insn_off / sizeof(struct bpf_insn) +
insns_cnt;
}
*func_info = data;