]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tracing: Add ftrace_partial_regs() for converting ftrace_regs to pt_regs
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Thu, 26 Dec 2024 05:12:47 +0000 (14:12 +0900)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Thu, 26 Dec 2024 15:50:03 +0000 (10:50 -0500)
commitb9b55c8912ce1e5555715d126486bdd63ddfeaec
tree5cf73bd3f03f207fb778e03a767249a2e466bc17
parent762abbc0d09f7ae123c82d315eb1a961c1a2cf7b
tracing: Add ftrace_partial_regs() for converting ftrace_regs to pt_regs

Add ftrace_partial_regs() which converts the ftrace_regs to pt_regs.
This is for the eBPF which needs this to keep the same pt_regs interface
to access registers.
Thus when replacing the pt_regs with ftrace_regs in fprobes (which is
used by kprobe_multi eBPF event), this will be used.

If the architecture defines its own ftrace_regs, this copies partial
registers to pt_regs and returns it. If not, ftrace_regs is the same as
pt_regs and ftrace_partial_regs() will return ftrace_regs::regs.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Acked-by: Florent Revest <revest@chromium.org>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Martin KaFai Lau <martin.lau@linux.dev>
Cc: bpf <bpf@vger.kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Alan Maguire <alan.maguire@oracle.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: Paul Walmsley <paul.walmsley@sifive.com>
Cc: Palmer Dabbelt <palmer@dabbelt.com>
Cc: Albert Ou <aou@eecs.berkeley.edu>
Link: https://lore.kernel.org/173518996761.391279.4987911298206448122.stgit@devnote2
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
arch/arm64/include/asm/ftrace.h
arch/riscv/include/asm/ftrace.h
include/linux/ftrace.h