linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/3] uprobe: uretprobe speed up
@ 2024-04-02  9:32 Jiri Olsa
  2024-04-02  9:33 ` [PATCHv2 1/3] uprobe: Add uretprobe syscall to speed up return probe Jiri Olsa
                   ` (2 more replies)
  0 siblings, 3 replies; 30+ messages in thread
From: Jiri Olsa @ 2024-04-02  9:32 UTC (permalink / raw)
  To: Steven Rostedt, Masami Hiramatsu, Oleg Nesterov,
	Alexei Starovoitov, Daniel Borkmann, Andrii Nakryiko
  Cc: linux-kernel, linux-trace-kernel, bpf, Song Liu, Yonghong Song,
	John Fastabend, Peter Zijlstra, Thomas Gleixner,
	Borislav Petkov (AMD), x86

hi,
as part of the effort on speeding up the uprobes [0] coming with
return uprobe optimization by using syscall instead of the trap
on the uretprobe trampoline.

The speed up depends on instruction type that uprobe is installed
and depends on specific HW type, please check patch 1 for details.

I added extra selftests to check on registers values before and
after uretprobe to make sure the syscall saves all the needed regs
and that uprobe consumer can still change registers.

Patch 1 is based on:
  https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
  probes/for-next

and patches 2,3 are based on bpf-next/master and can be taken
separately through bpf-next tree without patch 1.

v2 changes:
  - reposted to proper tracing mailing list [Masami]
  - renamed selftest trigger functions [Andrii]
  - kept bpf_testmod register call pattern [Andrii]
  - added acks [Andrii/Oleg]

thanks,
jirka


[0] https://lore.kernel.org/bpf/ZeCXHKJ--iYYbmLj@krava/
---
Jiri Olsa (3):
      uprobe: Add uretprobe syscall to speed up return probe
      selftests/bpf: Add uretprobe syscall test for regs integrity
      selftests/bpf: Add uretprobe syscall test for regs changes

 arch/x86/entry/syscalls/syscall_64.tbl                  |   1 +
 arch/x86/kernel/uprobes.c                               |  83 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/syscalls.h                                |   2 ++
 include/linux/uprobes.h                                 |   2 ++
 include/uapi/asm-generic/unistd.h                       |   5 +++-
 kernel/events/uprobes.c                                 |  18 +++++++++---
 kernel/sys_ni.c                                         |   2 ++
 tools/include/linux/compiler.h                          |   4 +++
 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c   | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/testing/selftests/bpf/progs/uprobe_syscall.c      |  15 ++++++++++
 11 files changed, 478 insertions(+), 6 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/uprobe_syscall.c
 create mode 100644 tools/testing/selftests/bpf/progs/uprobe_syscall.c

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

end of thread, other threads:[~2024-04-18 18:34 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-02  9:32 [PATCHv2 0/3] uprobe: uretprobe speed up Jiri Olsa
2024-04-02  9:33 ` [PATCHv2 1/3] uprobe: Add uretprobe syscall to speed up return probe Jiri Olsa
2024-04-03  1:07   ` Masami Hiramatsu
2024-04-03  9:47     ` Jiri Olsa
2024-04-03 13:56       ` Oleg Nesterov
2024-04-03 14:09       ` Masami Hiramatsu
2024-04-03 14:49         ` Oleg Nesterov
2024-04-03 16:58         ` Andrii Nakryiko
2024-04-04  0:58           ` Masami Hiramatsu
2024-04-04  2:00             ` Andrii Nakryiko
2024-04-04 11:58               ` Jiri Olsa
2024-04-04 16:06                 ` Masami Hiramatsu
2024-04-04 15:54               ` Masami Hiramatsu
2024-04-04 16:11                 ` Oleg Nesterov
2024-04-05  1:22                   ` Masami Hiramatsu
2024-04-05  8:56                     ` Jiri Olsa
2024-04-05 11:02                       ` Oleg Nesterov
2024-04-06  3:05                         ` Masami Hiramatsu
2024-04-06 17:55                           ` Oleg Nesterov
2024-04-08  3:54                             ` Masami Hiramatsu
2024-04-08 16:02                         ` Jiri Olsa
2024-04-08 16:22                           ` Oleg Nesterov
2024-04-09 12:06                             ` Jiri Olsa
2024-04-09  0:34                           ` Masami Hiramatsu
2024-04-09  7:57                             ` Jiri Olsa
2024-04-08  3:16                       ` Masami Hiramatsu
2024-04-15  8:25   ` Jiri Olsa
2024-04-18 18:34     ` Andrii Nakryiko
2024-04-02  9:33 ` [PATCHv2 bpf-next 2/3] selftests/bpf: Add uretprobe test for regs integrity Jiri Olsa
2024-04-02  9:33 ` [PATCHv2 bpf-next 3/3] selftests/bpf: Add uretprobe test for regs changes Jiri Olsa

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