[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171003201452.elth55atpquesjjk@ast-mbp.dhcp.thefacebook.com>
Date: Tue, 3 Oct 2017 13:14:54 -0700
From: Alexei Starovoitov <alexei.starovoitov@...il.com>
To: Jakub Kicinski <jakub.kicinski@...ronome.com>
Cc: daniel@...earbox.net, dsahern@...il.com, netdev@...r.kernel.org,
oss-drivers@...ronome.com, david.beckett@...ronome.com
Subject: Re: [RFC 1/2] bpf: move instruction printing into a separate file
On Tue, Oct 03, 2017 at 10:57:45AM -0700, Jakub Kicinski wrote:
> Separate the instruction printing into a standalone source file.
> This way sneaky code from tools/ can use it directly.
>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
> ---
> Like this?
...
> +static void print_bpf_end_insn(void (*verbose)(const char *, ...),
> + const struct bpf_insn *insn)
> +{
> + verbose("(%02x) r%d = %s%d r%d\n", insn->code, insn->dst_reg,
> + BPF_SRC(insn->code) == BPF_TO_BE ? "be" : "le",
> + insn->imm, insn->dst_reg);
> +}
...
> + print_bpf_insn(verbose, insn, env->allow_ptr_leaks);
since you're changing it please please please kill that global verbose() ugliness.
It's been on todo list for long time.
iirc that's the only thing that prevents us to remove global bpf_verifier_lock.
if we don't do it as part of this change, we'd need another one in the future
with equal amount of changed lines, so let's do it now.
Powered by blists - more mailing lists