netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: Taeung Song <treeze.taeung@gmail.com>
Cc: Daniel Borkmann <daniel@iogearbox.net>,
	Alexei Starovoitov <ast@kernel.org>,
	netdev@vger.kernel.org, Andrey Ignatov <rdna@fb.com>
Subject: Re: [PATCH bpf-next] libbpf: Show possible section(type) names on when failed to guess a type
Date: Wed, 19 Dec 2018 18:22:09 -0800	[thread overview]
Message-ID: <20181219182209.439cbf5a@cakuba.netronome.com> (raw)
In-Reply-To: <973b2059-179e-0131-9d41-288da6432dd0@gmail.com>

On Thu, 20 Dec 2018 09:47:12 +0900, Taeung Song wrote:
> On 12/20/18 3:52 AM, Jakub Kicinski wrote:
> > On Wed, 19 Dec 2018 17:52:40 +0900, Taeung Song wrote:  
> >> We need to let users check their wrong section name
> >> with proper section names when failed to get proper type from it.
> >> Because there is no knowing what kind of section name can be used.  
> > 
> > # bpftool prog help
> > Usage: bpftool prog { show | list } [PROG]
> > 	[...]
> > 	TYPE := { socket | kprobe | kretprobe | classifier | action |
> >                   tracepoint | raw_tracepoint | xdp | perf_event | cgroup/skb |
> >                   cgroup/sock | cgroup/dev | lwt_in | lwt_out | lwt_xmit |
> >                   lwt_seg6local | sockops | sk_skb | sk_msg | lirc_mode2 |
> >                   sk_reuseport | flow_dissector |
> >                   cgroup/bind4 | cgroup/bind6 | cgroup/post_bind4 |
> >                   cgroup/post_bind6 | cgroup/connect4 | cgroup/connect6 |
> >                   cgroup/sendmsg4 | cgroup/sendmsg6 }
> >         ATTACH_TYPE := { msg_verdict | skb_verdict | skb_parse |
> >                          flow_dissector }
> >         OPTIONS := { {-j|--json} [{-p|--pretty}] | {-f|--bpffs} |
> > 	            {-m|--mapcompat} | {-n|--nomount} }
> > 
> > Also in man bpftool-prog.
> > 
> > Perhaps we could just point users to that info?  IMHO having libraries  
> 
> Right, I think when users used wrong section names
> we need to let them realize libbpf guess prog/attach types from given 
> section names because users who are unfamiliar with BPF programming
> mightn't even know that, right ?

The error messages says:

	failed to guess program type based on section name X

I'm not good with user friendly error messages, unfortunately but to me
it clearly state we tried to guess the type based on section name..

Perhaps we could improve it?  Say "ELF section name"?  Take the section
name into single quotes?  Not sure..

> And how about a function that return supported section names ?
> I think it can be used for the 'TYPE'/'ATTACH_TYPE' help message
> because it is just a string and couldn't have latest types.

The man page has to be updated manually, anyway, no?  I don't have a
strong opinion as long as formatting doesn't suffer.

      reply	other threads:[~2018-12-20  2:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-19  8:52 [PATCH bpf-next] libbpf: Show possible section(type) names on when failed to guess a type Taeung Song
2018-12-19 11:26 ` Quentin Monnet
2018-12-20  0:17   ` Taeung Song
2018-12-19 18:52 ` Jakub Kicinski
2018-12-20  0:47   ` Taeung Song
2018-12-20  2:22     ` Jakub Kicinski [this message]

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=20181219182209.439cbf5a@cakuba.netronome.com \
    --to=jakub.kicinski@netronome.com \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=netdev@vger.kernel.org \
    --cc=rdna@fb.com \
    --cc=treeze.taeung@gmail.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).