[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200624003340.802375-1-andriin@fb.com>
Date: Tue, 23 Jun 2020 17:33:39 -0700
From: Andrii Nakryiko <andriin@...com>
To: <bpf@...r.kernel.org>, <netdev@...r.kernel.org>, <ast@...com>,
<daniel@...earbox.net>
CC: <andrii.nakryiko@...il.com>, <kernel-team@...com>,
Andrii Nakryiko <andriin@...com>
Subject: [PATCH bpf-next] libbpf: add debug message for each created program
Similar message for map creation is extremely useful, so add similar for BPF
programs.
Signed-off-by: Andrii Nakryiko <andriin@...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
Powered by blists - more mailing lists