From: Steven Rostedt <rostedt@goodmis.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: linux-kernel@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Jiri Olsa <jolsa@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [RFC][PATCH 0/2] ftrace: Add access to function arguments for all callbacks
Date: Wed, 28 Oct 2020 18:07:53 -0400 [thread overview]
Message-ID: <20201028180753.238335d1@oasis.local.home> (raw)
In-Reply-To: <20201028213303.shosfclmhxkai2ir@ast-mbp.dhcp.thefacebook.com>
On Wed, 28 Oct 2020 14:33:03 -0700
Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> I don't have strong opinion on this feature, but if you want to have it
> please add a giant disclaimer that this is going to be x86-64 and, may be arm64,
> feature _forever_. On x86-32 and other architectures there is no way
> to provide sane regs_get_kernel_argument(regs, n) semantics by blindly
> saving registers. The kernel needs to know types and calling convention
> of the architecture. That's the reason bpf side has btf_func_model concept.
> To make sure that bpf trampoline can support all architectures in the future.
The trampoline is to only provide the information to get the arguments.
Yes, it is up to the callback that registered it that knows how to get them.
What does the bpf trampoline need to get an argument if it already
knows the type. If it has access to a subset of necessary registers and
the stack pointer of when the function was called, is it possible to
figure out the arguments?
This code is not about a "regs_get_kernel_argument(regs, n)", that was
only used to show that *that* could be done. Because currently, there's
*no* way to get those arguments without setting the SAVE_REGS flag,
which saves way more than necessary. I only used that to test the code
in a generic way. Ideally, ftrace could use btf to figure out the
actual arguments of the function if it had a mapping.
I believe the reason you gave up on using ftrace was because of the
overhead of the REGS code. If that wasn't the case, and you didn't see
that overhead, would you have used ftrace?
In fact, did you look at all to see if you could modify the current
infrastructure to make it work for you? Or did you just give up to
write your own from scratch?
-- Steve
next prev parent reply other threads:[~2020-10-28 22:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-28 13:15 Steven Rostedt
2020-10-28 13:15 ` [RFC][PATCH 1/2] ftrace/x86: Allow for arguments to be passed in to REGS by default Steven Rostedt
2020-10-28 14:25 ` [RFC][PATCH 1/2 v2] " Steven Rostedt
2020-10-28 15:29 ` Steven Rostedt
2020-10-28 20:36 ` Steven Rostedt
2020-10-28 21:14 ` Steven Rostedt
2020-10-29 8:07 ` Masami Hiramatsu
2020-10-28 13:15 ` [RFC][PATCH 2/2] ftrace: Test arguments by adding trace_printk in function tracer Steven Rostedt
2020-10-28 21:33 ` [RFC][PATCH 0/2] ftrace: Add access to function arguments for all callbacks Alexei Starovoitov
2020-10-28 22:07 ` Steven Rostedt [this message]
2020-10-28 23:03 ` Alexei Starovoitov
2020-10-28 23:16 ` Steven Rostedt
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=20201028180753.238335d1@oasis.local.home \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=alexei.starovoitov@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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
all inboxes | Powered by JetHome®