netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v10 00/12] fprobe: Introduce fprobe function entry/exit probe
@ 2022-03-08 11:08 Masami Hiramatsu
  2022-03-08 11:08 ` [PATCH v10 01/12] ftrace: Add ftrace_set_filter_ips function Masami Hiramatsu
                   ` (11 more replies)
  0 siblings, 12 replies; 19+ messages in thread
From: Masami Hiramatsu @ 2022-03-08 11:08 UTC (permalink / raw)
  To: Jiri Olsa, Alexei Starovoitov
  Cc: Daniel Borkmann, Andrii Nakryiko, Masami Hiramatsu, netdev, bpf,
	lkml, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Steven Rostedt, Naveen N . Rao, Anil S Keshavamurthy,
	David S . Miller

Hi,

Here is the 10th version of fprobe. In this version, the rethook arm support
([7/12]) comes back :-D, add an internal rethook flag for identify the context
([3-8/12]), and simplifies the ftrace_location lookup loops([2/12]) according
to Jiri's comment :)

The previous version (v9) is here[1];

[1] https://lore.kernel.org/all/164655933970.1674510.3809060481512713846.stgit@devnote2/T/#u

This series introduces the fprobe, the function entry/exit probe
with multiple probe point support for x86, arm64 and powerpc64le.
This also introduces the rethook for hooking function return as same as
the kretprobe does. This abstraction will help us to generalize the fgraph
tracer, because we can just switch to it from the rethook in fprobe,
depending on the kernel configuration.

The patch [1/10] is from Jiri's series[2].

[2] https://lore.kernel.org/all/20220104080943.113249-1-jolsa@kernel.org/T/#u

And the patch [9/10] adds the FPROBE_FL_KPROBE_SHARED flag for the case
if user wants to share the same code (or share a same resource) on the
fprobe and the kprobes.

I forcibly updated my kprobes/fprobe branch, you can pull this series
from:

 https://git.kernel.org/pub/scm/linux/kernel/git/mhiramat/linux.git kprobes/fprobe

Thank you,

---

Jiri Olsa (1):
      ftrace: Add ftrace_set_filter_ips function

Masami Hiramatsu (11):
      fprobe: Add ftrace based probe APIs
      rethook: Add a generic return hook
      rethook: x86: Add rethook x86 implementation
      arm64: rethook: Add arm64 rethook implementation
      powerpc: Add rethook support
      ARM: rethook: Add rethook arm implementation
      fprobe: Add exit_handler support
      fprobe: Add sample program for fprobe
      fprobe: Introduce FPROBE_FL_KPROBE_SHARED flag for fprobe
      docs: fprobe: Add fprobe description to ftrace-use.rst
      fprobe: Add a selftest for fprobe


 Documentation/trace/fprobe.rst                |  171 +++++++++++++
 Documentation/trace/index.rst                 |    1 
 arch/arm/Kconfig                              |    1 
 arch/arm/include/asm/stacktrace.h             |    4 
 arch/arm/kernel/stacktrace.c                  |    6 
 arch/arm/probes/Makefile                      |    1 
 arch/arm/probes/rethook.c                     |  101 ++++++++
 arch/arm64/Kconfig                            |    1 
 arch/arm64/include/asm/stacktrace.h           |    2 
 arch/arm64/kernel/probes/Makefile             |    1 
 arch/arm64/kernel/probes/rethook.c            |   25 ++
 arch/arm64/kernel/probes/rethook_trampoline.S |   87 +++++++
 arch/arm64/kernel/stacktrace.c                |    7 -
 arch/powerpc/Kconfig                          |    1 
 arch/powerpc/kernel/Makefile                  |    1 
 arch/powerpc/kernel/rethook.c                 |   72 +++++
 arch/x86/Kconfig                              |    1 
 arch/x86/include/asm/unwind.h                 |    8 +
 arch/x86/kernel/Makefile                      |    1 
 arch/x86/kernel/kprobes/common.h              |    1 
 arch/x86/kernel/rethook.c                     |  115 +++++++++
 include/linux/fprobe.h                        |  105 ++++++++
 include/linux/ftrace.h                        |    3 
 include/linux/kprobes.h                       |    3 
 include/linux/rethook.h                       |  100 ++++++++
 include/linux/sched.h                         |    3 
 kernel/exit.c                                 |    2 
 kernel/fork.c                                 |    3 
 kernel/trace/Kconfig                          |   26 ++
 kernel/trace/Makefile                         |    2 
 kernel/trace/fprobe.c                         |  332 +++++++++++++++++++++++++
 kernel/trace/ftrace.c                         |   58 ++++
 kernel/trace/rethook.c                        |  317 ++++++++++++++++++++++++
 lib/Kconfig.debug                             |   12 +
 lib/Makefile                                  |    2 
 lib/test_fprobe.c                             |  174 +++++++++++++
 samples/Kconfig                               |    7 +
 samples/Makefile                              |    1 
 samples/fprobe/Makefile                       |    3 
 samples/fprobe/fprobe_example.c               |  120 +++++++++
 40 files changed, 1867 insertions(+), 14 deletions(-)
 create mode 100644 Documentation/trace/fprobe.rst
 create mode 100644 arch/arm/probes/rethook.c
 create mode 100644 arch/arm64/kernel/probes/rethook.c
 create mode 100644 arch/arm64/kernel/probes/rethook_trampoline.S
 create mode 100644 arch/powerpc/kernel/rethook.c
 create mode 100644 arch/x86/kernel/rethook.c
 create mode 100644 include/linux/fprobe.h
 create mode 100644 include/linux/rethook.h
 create mode 100644 kernel/trace/fprobe.c
 create mode 100644 kernel/trace/rethook.c
 create mode 100644 lib/test_fprobe.c
 create mode 100644 samples/fprobe/Makefile
 create mode 100644 samples/fprobe/fprobe_example.c

--
Masami Hiramatsu (Linaro) <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-03-12  1:57 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08 11:08 [PATCH v10 00/12] fprobe: Introduce fprobe function entry/exit probe Masami Hiramatsu
2022-03-08 11:08 ` [PATCH v10 01/12] ftrace: Add ftrace_set_filter_ips function Masami Hiramatsu
2022-03-08 11:08 ` [PATCH v10 02/12] fprobe: Add ftrace based probe APIs Masami Hiramatsu
2022-03-08 11:09 ` [PATCH v10 03/12] rethook: Add a generic return hook Masami Hiramatsu
2022-03-11  3:52   ` Hou Tao
2022-03-08 11:09 ` [PATCH v10 04/12] rethook: x86: Add rethook x86 implementation Masami Hiramatsu
2022-03-08 11:09 ` [PATCH v10 05/12] arm64: rethook: Add arm64 rethook implementation Masami Hiramatsu
2022-03-08 11:09 ` [PATCH v10 06/12] powerpc: Add rethook support Masami Hiramatsu
2022-03-08 11:09 ` [PATCH v10 07/12] ARM: rethook: Add rethook arm implementation Masami Hiramatsu
2022-03-08 11:10 ` [PATCH v10 08/12] fprobe: Add exit_handler support Masami Hiramatsu
2022-03-08 11:10 ` [PATCH v10 09/12] fprobe: Add sample program for fprobe Masami Hiramatsu
2022-03-08 11:10 ` [PATCH v10 10/12] fprobe: Introduce FPROBE_FL_KPROBE_SHARED flag " Masami Hiramatsu
2022-03-08 11:10 ` [PATCH v10 11/12] docs: fprobe: Add fprobe description to ftrace-use.rst Masami Hiramatsu
2022-03-08 11:10 ` [PATCH v10 12/12] fprobe: Add a selftest for fprobe Masami Hiramatsu
2022-03-10  0:17   ` Masami Hiramatsu
2022-03-10  0:40     ` Andrii Nakryiko
2022-03-10 15:11       ` Masami Hiramatsu
2022-03-11 18:35         ` Andrii Nakryiko
2022-03-12  1:57           ` Masami Hiramatsu

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).