From: Andrii Nakryiko <andriin@fb.com>
To: <bpf@vger.kernel.org>, <netdev@vger.kernel.org>, <ast@fb.com>,
<daniel@iogearbox.net>
Cc: <andrii.nakryiko@gmail.com>, <kernel-team@fb.com>,
Andrii Nakryiko <andriin@fb.com>
Subject: [PATCH bpf-next] libbpf: add debug message for each created program
Date: Tue, 23 Jun 2020 17:33:39 -0700 [thread overview]
Message-ID: <20200624003340.802375-1-andriin@fb.com> (raw)
Similar message for map creation is extremely useful, so add similar for BPF
programs.
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
---
tools/lib/bpf/libbpf.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index 18461deb1b19..f24a90c86c58 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -5379,8 +5379,9 @@ load_program(struct bpf_program *prog, struct bpf_insn *insns, int insns_cnt,
}
ret = bpf_load_program_xattr(&load_attr, log_buf, log_buf_size);
-
if (ret >= 0) {
+ pr_debug("prog '%s' ('%s'): created successfully, fd=%d\n",
+ prog->name, prog->section_name, ret);
if (log_buf && load_attr.log_level)
pr_debug("verifier log:\n%s", log_buf);
*pfd = ret;
--
2.24.1
next reply other threads:[~2020-06-24 0:33 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 0:33 Andrii Nakryiko [this message]
2020-06-24 6:47 ` [PATCH bpf-next] libbpf: add debug message for each created program Alexei Starovoitov
2020-06-24 6:59 ` Andrii Nakryiko
2020-06-24 14:52 ` Alexei Starovoitov
2020-06-24 15:03 ` Toke Høiland-Jørgensen
2020-06-24 16:34 ` Andrii Nakryiko
2020-06-24 17:38 ` Alexei Starovoitov
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=20200624003340.802375-1-andriin@fb.com \
--to=andriin@fb.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@fb.com \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.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).