]> granicus.if.org Git - strace/commitdiff
bpf: move print_big_u64_addr inside print_ebpf_prog
authorEugene Syromyatnikov <evgsyr@gmail.com>
Fri, 1 Jun 2018 00:36:59 +0000 (02:36 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 2 Jun 2018 16:32:10 +0000 (16:32 +0000)
* 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 <ldv@altlinux.org>
bpf.c

diff --git a/bpf.c b/bpf.c
index eaf87d3ba8ee721671bbdec3dd72bd229ecbb7ac..9abc21409a0de51307dc5f96f6ed8f11c9d81358 100644 (file)
--- 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);