TencentOS-kernel/tools/bpf
Yonghong Song 1b268c27b9 bpftool: Print subprog address properly
[upstream commit f1f9f0d8d737b9a1c5d15635bf5696643626fd39]

With later hashmap example, using bpftool xlated output may
look like:
  int dump_task(struct bpf_iter__task * ctx):
  ; struct task_struct *task = ctx->task;
     0: (79) r2 = *(u64 *)(r1 +8)
  ; if (task == (void *)0 || called > 0)
  ...
    19: (18) r2 = subprog[+17]
    30: (18) r2 = subprog[+25]
  ...
  36: (95) exit
  __u64 check_hash_elem(struct bpf_map * map, __u32 * key, __u64 * val,
                        struct callback_ctx * data):
  ; struct bpf_iter__task *ctx = data->ctx;
    37: (79) r5 = *(u64 *)(r4 +0)
  ...
    55: (95) exit
  __u64 check_percpu_elem(struct bpf_map * map, __u32 * key,
                          __u64 * val, void * unused):
  ; check_percpu_elem(struct bpf_map *map, __u32 *key, __u64 *val, void *unused)
    56: (bf) r6 = r3
  ...
    83: (18) r2 = subprog[-47]

Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210226204931.3885458-1-yhs@fb.com
2022-06-21 10:27:21 +08:00
..
bpftool bpftool: Print subprog address properly 2022-06-21 10:27:21 +08:00
resolve_btfids libbpf: update libbpf to v0.2.0 2022-06-21 10:27:17 +08:00
runqslower bpftool: sync bpftool from 5.10 2022-06-21 10:27:17 +08:00
.gitignore bpftool: sync bpftool from 5.10 2022-06-21 10:27:17 +08:00
Makefile bpftool: sync bpftool from 5.10 2022-06-21 10:27:17 +08:00
Makefile.helpers Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bpf_asm.c bpftool: sync bpftool from 5.10 2022-06-21 10:27:17 +08:00
bpf_dbg.c bpftool: sync bpftool from 5.10 2022-06-21 10:27:17 +08:00
bpf_exp.l Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
bpf_exp.y bpftool: sync bpftool from 5.10 2022-06-21 10:27:17 +08:00
bpf_jit_disasm.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00