From d4b2f1c4b64936d71a887750a85f85239290870e Mon Sep 17 00:00:00 2001 From: Eugene Syromyatnikov Date: Fri, 1 Jun 2018 02:36:59 +0200 Subject: [PATCH] bpf: move print_big_u64_addr inside print_ebpf_prog * bpf.c (print_ebpf_prog): Add static qualifier. Change the type of "addr" argument from kernel_ulong_t to uint64_t, print it using print_big_u64_addr. (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD), print_bpf_prog_info): Do not call print_big_u64_addr before print_ebpf_prog. Co-Authored-by: Dmitry V. Levin --- bpf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bpf.c b/bpf.c index eaf87d3b..9abc2140 100644 --- a/bpf.c +++ b/bpf.c @@ -161,10 +161,11 @@ print_ebpf_insn(struct tcb * const tcp, void * const elem_buf, return true; } -void -print_ebpf_prog(struct tcb *const tcp, const kernel_ulong_t addr, +static void +print_ebpf_prog(struct tcb *const tcp, const uint64_t addr, const uint32_t len) { + print_big_u64_addr(addr); if (abbrev(tcp)) { printaddr(addr); } else { @@ -274,7 +275,6 @@ BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD) "BPF_PROG_TYPE_???"); PRINT_FIELD_U(", ", attr, insn_cnt); tprints(", insns="); - print_big_u64_addr(attr.insns); print_ebpf_prog(tcp, attr.insns, attr.insn_cnt); tprintf(", license="); @@ -504,7 +504,6 @@ print_bpf_prog_info(struct tcb * const tcp, uint32_t bpf_fd, tprintf("%" PRIu32, info.xlated_prog_len); tprints(", xlated_prog_insns="); - print_big_u64_addr(info.xlated_prog_insns); print_ebpf_prog(tcp, info.xlated_prog_insns, info.xlated_prog_len / 8); PRINT_FIELD_U(", ", info, load_time); -- 2.40.0