[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <553FEF9C.6010104@plumgrid.com>
Date: Tue, 28 Apr 2015 13:37:48 -0700
From: Alexei Starovoitov <ast@...mgrid.com>
To: Daniel Borkmann <daniel@...earbox.net>, stephen@...workplumber.org
CC: netdev@...r.kernel.org
Subject: Re: [PATCH iproute2 -master] tc: {m,f}_ebpf: add option for dumping
verifier log
On 4/28/15 4:37 AM, Daniel Borkmann wrote:
> Currently, only on error we get a log dump, but I found it useful when
> working with eBPF to have an option to also dump the log on success.
> Also spotted a typo in a header comment, which is fixed here as well.
>
> Signed-off-by: Daniel Borkmann <daniel@...earbox.net>
> Cc: Alexei Starovoitov <ast@...mgrid.com>
...
> @@ -284,8 +287,11 @@ static int bpf_prog_attach(enum bpf_prog_type type, const struct bpf_insn *insns
> {
> int prog_fd = bpf_prog_load(type, insns, size, license);
>
> - if (prog_fd < 0)
> - bpf_dump_error("BPF program rejected: %s\n", strerror(errno));
> + if (prog_fd < 0 || bpf_verbose) {
> + bpf_dump_error("%s: %s\n", prog_fd < 0 ?
> + "BPF program rejected" :
> + "BPF program verification", strerror(errno));
> + }
I have very similar hack locally that I stash/unstash periodically for
debugging. Good thing to have it in generic form.
Acked-by: Alexei Starovoitov <ast@...mgrid.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists