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 <dan...@iogearbox.net>
Cc: Alexei Starovoitov <a...@plumgrid.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 <a...@plumgrid.com>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html