bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Quentin Monnet <quentin@isovalent.com>,
	Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>
Cc: bpf@vger.kernel.org, netdev@vger.kernel.org,
	Quentin Monnet <quentin@isovalent.com>,
	Andrii Nakryiko <andriin@fb.com>
Subject: RE: [PATCH bpf-next] tools: bpftool: restore message on failure to guess program type
Date: Wed, 11 Mar 2020 16:42:14 -0700	[thread overview]
Message-ID: <5e69775639097_20552ab9153405b46b@john-XPS-13-9370.notmuch> (raw)
In-Reply-To: <20200311021205.9755-1-quentin@isovalent.com>

Quentin Monnet wrote:
> In commit 4a3d6c6a6e4d ("libbpf: Reduce log level for custom section
> names"), log level for messages for libbpf_attach_type_by_name() and
> libbpf_prog_type_by_name() was downgraded from "info" to "debug". The
> latter function, in particular, is used by bpftool when attempting to
> load programs, and this change caused bpftool to exit with no hint or
> error message when it fails to detect the type of the program to load
> (unless "-d" option was provided).
> 
> To help users understand why bpftool fails to load the program, let's do
> a second run of the function with log level in "debug" mode in case of
> failure.
> 
> Before:
> 
>     # bpftool prog load sample_ret0.o /sys/fs/bpf/sample_ret0
>     # echo $?
>     255
> 
> Or really verbose with -d flag:
> 
>     # bpftool -d prog load sample_ret0.o /sys/fs/bpf/sample_ret0
>     libbpf: loading sample_ret0.o
>     libbpf: section(1) .strtab, size 134, link 0, flags 0, type=3

[...]

> After:
> 
>     # bpftool prog load sample_ret0.o /sys/fs/bpf/sample_ret0
>     libbpf: failed to guess program type from ELF section '.text'
>     libbpf: supported section(type) names are: socket sk_reuseport kprobe/ [...]
> 
> Signed-off-by: Quentin Monnet <quentin@isovalent.com>

lgtm

Acked-by: John Fastabend <john.fastabend@gmail.com>

  reply	other threads:[~2020-03-11 23:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11  2:12 [PATCH bpf-next] tools: bpftool: restore message on failure to guess program type Quentin Monnet
2020-03-11 23:42 ` John Fastabend [this message]
2020-03-13  1:11 ` 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=5e69775639097_20552ab9153405b46b@john-XPS-13-9370.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=quentin@isovalent.com \
    /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).