All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bpf-next] libbpf: demote log message about unrecognised data sections back down to debug
@ 2021-11-04 12:29 Toke Høiland-Jørgensen
  2021-11-04 18:20 ` Yonghong Song
  2021-11-04 21:16 ` Andrii Nakryiko
  0 siblings, 2 replies; 8+ messages in thread
From: Toke Høiland-Jørgensen @ 2021-11-04 12:29 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: Toke Høiland-Jørgensen, bpf, Magnus Karlsson,
	Ciara Loftus

When loading a BPF object, libbpf will output a log message when it
encounters an unrecognised data section. Since commit
50e09460d9f8 ("libbpf: Skip well-known ELF sections when iterating ELF")
they are printed at "info" level so they will show up on the console by
default.

The rationale in the commit cited above is to "increase visibility" of such
errors, but there can be legitimate, and completely harmless, uses of extra
data sections. In particular, libxdp uses custom data sections to store
metadata and run priority configuration of XDP programs, which triggers the
log message. Ciara noticed that when porting XSK code to use libxdp instead
of libbpf as part of the deprecation, libbpf would output messages like:

libbpf: elf: skipping unrecognized data section(7) .xdp_run_config
libbpf: elf: skipping unrecognized data section(8) xdp_metadata
libbpf: elf: skipping unrecognized data section(8) xdp_metadata
libbpf: elf: skipping unrecognized data section(8) xdp_metadata

In light of this, let's demote the message severity back down to debug so
that it won't clutter up the default output of applications.

Cc: Magnus Karlsson <magnus.karlsson@intel.com>
Reported-by: Ciara Loftus <ciara.loftus@intel.com>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
---
 tools/lib/bpf/libbpf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
index a1bea1953df6..ac0eadbe1475 100644
--- a/tools/lib/bpf/libbpf.c
+++ b/tools/lib/bpf/libbpf.c
@@ -3297,8 +3297,8 @@ static int bpf_object__elf_collect(struct bpf_object *obj)
 				obj->efile.st_ops_data = data;
 				obj->efile.st_ops_shndx = idx;
 			} else {
-				pr_info("elf: skipping unrecognized data section(%d) %s\n",
-					idx, name);
+				pr_debug("elf: skipping unrecognized data section(%d) %s\n",
+					 idx, name);
 			}
 		} else if (sh->sh_type == SHT_REL) {
 			int targ_sec_idx = sh->sh_info; /* points to other section */
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-11-10 11:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-04 12:29 [PATCH bpf-next] libbpf: demote log message about unrecognised data sections back down to debug Toke Høiland-Jørgensen
2021-11-04 18:20 ` Yonghong Song
2021-11-04 21:16 ` Andrii Nakryiko
2021-11-05 14:34   ` Toke Høiland-Jørgensen
2021-11-05 18:41     ` Andrii Nakryiko
2021-11-08 12:16       ` Toke Høiland-Jørgensen
2021-11-10  1:13         ` Andrii Nakryiko
2021-11-10 11:27           ` Toke Høiland-Jørgensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.