bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrii Nakryiko <andrii.nakryiko@gmail.com>
To: Arnaldo Carvalho de Melo <arnaldo.melo@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>, Martin KaFai Lau <kafai@fb.com>,
	Jiri Olsa <jolsa@kernel.org>,
	dwarves@vger.kernel.org, bpf <bpf@vger.kernel.org>,
	Kernel Team <kernel-team@fb.com>,
	Andrii Nakryiko <andrii@kernel.org>
Subject: Re: [PATCH dwarves] btf: Generate btf for functions in the .BTF_ids section
Date: Wed, 28 Apr 2021 12:45:10 -0700	[thread overview]
Message-ID: <CAEf4BzbzYeG9fWPe=Vugq8WG6bK79dk3byjWV9gtCX_v7L0XLw@mail.gmail.com> (raw)
In-Reply-To: <YIle2kdR4IniQnbN@kernel.org>

On Wed, Apr 28, 2021 at 6:10 AM Arnaldo Carvalho de Melo
<arnaldo.melo@gmail.com> wrote:
>
> Em Tue, Apr 27, 2021 at 01:38:51PM -0700, Andrii Nakryiko escreveu:
> > On Tue, Apr 27, 2021 at 5:34 AM Arnaldo Carvalho de Melo <acme@kernel.org> wrote:
>
> > > And tools that expect to trace a function can get that information from
> > > the BTF info instead of getting some failure when trying to trace those
> > > functions, right?
>
> > I don't think it belongs in BTF, though.
>
> My thinking was that since BTF is used when tracing, one would be
> interested in knowing if some functions can't be used for that.
>
> > Plus there are additional limitations enforced by BPF verifier that
> > will prevent some functions to be attached. So just because the
> > function is in BTF doesn't mean it's 100% attachable.
>
> Well, at least we would avoid some that can't for sure be used for
> tracing. But, a bit in there is precious, so probably geting a NACK from
> the kernel should be a good enough capability query. :-)
>
> Tools should just silently prune things in wildcards provided by the
> user that aren't traceable, silently, and provide an error message when
> the user explicitely asks for tracing a verbotten function.

Yep, that's what I'm doing in my retsnoop tool (I both filter by
available kprobes [0], and have extra blacklist [1]). Loading kprobes
is pretty simple and fast enough, shouldn't be a problem.

  [0] https://github.com/anakryiko/retsnoop/blob/master/src/mass_attacher.c#L495
  [1] https://github.com/anakryiko/retsnoop/blob/master/src/mass_attacher.c#L41


>
> - Arnaldo

  reply	other threads:[~2021-04-28 19:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-23 21:37 [PATCH dwarves] btf: Generate btf for functions in the .BTF_ids section Martin KaFai Lau
2021-04-26 23:26 ` Andrii Nakryiko
2021-04-27 11:38   ` Jiri Olsa
2021-04-27 12:34     ` Arnaldo Carvalho de Melo
2021-04-27 12:43       ` Jiri Olsa
2021-04-27 20:38       ` Andrii Nakryiko
2021-04-28 13:10         ` Arnaldo Carvalho de Melo
2021-04-28 19:45           ` Andrii Nakryiko [this message]
2021-04-28 22:05             ` Arnaldo Carvalho de Melo
2021-05-01  0:16     ` Martin KaFai Lau
2021-05-01 22:23       ` Jiri Olsa
2021-04-27 11:42 ` Jiri Olsa
2021-04-27 18:20   ` Martin KaFai Lau

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='CAEf4BzbzYeG9fWPe=Vugq8WG6bK79dk3byjWV9gtCX_v7L0XLw@mail.gmail.com' \
    --to=andrii.nakryiko@gmail.com \
    --cc=andrii@kernel.org \
    --cc=arnaldo.melo@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=dwarves@vger.kernel.org \
    --cc=jolsa@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=kafai@fb.com \
    --cc=kernel-team@fb.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).