bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiri Olsa <jolsa@redhat.com>,
	Alan Maguire <alan.maguire@oracle.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	bpf@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] tracing: BTF testing for kprobe-events
Date: Wed, 13 Oct 2021 21:52:06 +0900	[thread overview]
Message-ID: <20211013215206.c7b49db96a939fc71eb988b3@kernel.org> (raw)
In-Reply-To: <20211011182334.5030b2d8@gandalf.local.home>

On Mon, 11 Oct 2021 18:23:34 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Thu, 23 Sep 2021 21:39:43 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > Hi Steve,
> > 
> 
> Hi Masami,
> 
> Sorry for the late reply, but Plumbers followed by OSS put me way behind,
> and I just got to this email :-/
> 
> > Here I share my testing patch of the BTF for kprobe events.
> > Currently this only allow user to specify '$$args' for
> > tracing all arguments of the function. This is only
> > avaialbe if
> > - the probe point is on the function entry
> > - the kernel is compiled with BTF (CONFIG_DEBUG_INFO_BTF)
> > - the kernel is enables BPF (CONFIG_BPF_SYSCALL)
> > 
> > And Special thanks to Sven! Most of BTF handling part of
> > this patch comes from his patch [1]
> > 
> > [1] https://stackframe.org/0001-ftrace-arg-hack.patch
> 
> Which is newer than this patch because he sent a v2, and that's a couple
> patches down in my queue. I'll be looking at that one shortly as well.

Did he send his BTF hack patch to you ?
I didn't notice that.


> > What I thought while coding this were;
> > - kernel/bpf/btf.c can be moved under lib/ so that
> >   the other subsystems can reuse it, independent
> >   from BPF. (Also, this should depends on CONFIG_DEBUG_INFO_BTF)
> 
> Makes sense.
> 
> > - some more utility functions can be exposed.
> >   e.g. I copied btf_type_int() from btf.c
> 
> Agreed.
> 
> > - If there are more comments for the BTF APIs, it will
> >   be more useful...
> > - Overall, the BTF is easy to understand for who
> >   already understand DWARF. Great work!
> 
> Great to hear.
> 
> > - I think I need 'ptr' and 'bool' types for fetcharg types.
> > 
> > Anyway, this is just for testing. I have to add some
> > more cleanup, features and documentations, etc.
> 
> This is awesome, and something to look at for a generic ftrace args point
> of view too.
> 
> One issue is how do we handle multiple register values? Like a u64 type on
> 32 bit?  As $arg1 is just a register that is in $arg1, for a u64 parameter
> on 32 bit, that is usually handled with two registers.
> 
> Have thoughts on that?

Oh, that's a good point! The probe event supports such case, since I expected
the user will use 2 arguments to record it. But indeed, using BTF means we need
such extension.
OK, let me consider how to extend fetchargs to support it.

Thank you!

> 
> I'll play with your patch today.
> 
> -- Steve


-- 
Masami Hiramatsu <mhiramat@kernel.org>

      reply	other threads:[~2021-10-13 12:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-23 12:39 [RFC PATCH] tracing: BTF testing for kprobe-events Masami Hiramatsu
2021-09-23 12:39 ` [RFC PATCH] tracing/kprobe: Support $$args for function entry Masami Hiramatsu
2021-09-24 17:51   ` Alan Maguire
2021-09-25 14:15     ` Masami Hiramatsu
2021-10-11 22:23 ` [RFC PATCH] tracing: BTF testing for kprobe-events Steven Rostedt
2021-10-13 12:52   ` Masami Hiramatsu [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=20211013215206.c7b49db96a939fc71eb988b3@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=alan.maguire@oracle.com \
    --cc=bpf@vger.kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=svens@linux.ibm.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).