From: Alexei Starovoitov <ast@plumgrid.com>
To: Daniel Borkmann <daniel@iogearbox.net>, stephen@networkplumber.org
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH iproute2 -master] tc: {m,f}_ebpf: add option for dumping verifier log
Date: Tue, 28 Apr 2015 13:37:48 -0700 [thread overview]
Message-ID: <553FEF9C.6010104@plumgrid.com> (raw)
In-Reply-To: <b312101ba95af54ffd2f4c56694c0b44ccbfa051.1430220466.git.daniel@iogearbox.net>
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@iogearbox.net>
> Cc: Alexei Starovoitov <ast@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 <ast@plumgrid.com>
next prev parent reply other threads:[~2015-04-28 20:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 11:37 [PATCH iproute2 -master] tc: {m,f}_ebpf: add option for dumping verifier log Daniel Borkmann
2015-04-28 20:37 ` Alexei Starovoitov [this message]
2015-05-04 15:46 ` Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=553FEF9C.6010104@plumgrid.com \
--to=ast@plumgrid.com \
--cc=daniel@iogearbox.net \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).