linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv5 bpf-next 00/13] uprobe, bpf: Add session support
@ 2024-09-29 20:57 Jiri Olsa
  2024-09-29 20:57 ` [PATCHv5 bpf-next 01/13] uprobe: Add data pointer to consumer handlers Jiri Olsa
                   ` (12 more replies)
  0 siblings, 13 replies; 29+ messages in thread
From: Jiri Olsa @ 2024-09-29 20:57 UTC (permalink / raw)
  To: Oleg Nesterov, Peter Zijlstra, Alexei Starovoitov,
	Daniel Borkmann, Andrii Nakryiko
  Cc: bpf, Martin KaFai Lau, Song Liu, Yonghong Song, John Fastabend,
	KP Singh, Stanislav Fomichev, Hao Luo, Steven Rostedt,
	Masami Hiramatsu, linux-kernel, linux-trace-kernel

hi,
this patchset is adding support for session uprobe attachment and
using it through bpf link for bpf programs.

The session means that the uprobe consumer is executed on entry
and return of probed function with additional control:
  - entry callback can control execution of the return callback
  - entry and return callbacks can share data/cookie

On more details please see patch #2.

Kernel uprobe changes are applicable on Peter's perf/core:
  git://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core

The whole patchset is based on bpf-next/master because the tooling
bits need changes that are not yet merged in peter's tree.

v5 changes:
  - removed IWANTMYCOOKIE return value, instead we pass cookie when both
    'handler' and 'ret_handler' callbacks are defined in consumer [Andrii]
  - move return_consumer_find call under uc->ret_handler check [Oleg] 
  - dropped uprobe stress selftest, don't think it's needed

thanks,
jirka


---
Jiri Olsa (13):
      uprobe: Add data pointer to consumer handlers
      uprobe: Add support for session consumer
      bpf: Add support for uprobe multi session attach
      bpf: Add support for uprobe multi session context
      bpf: Allow return values 0 and 1 for uprobe/kprobe session
      libbpf: Add support for uprobe multi session attach
      selftests/bpf: Add uprobe session test
      selftests/bpf: Add uprobe session cookie test
      selftests/bpf: Add uprobe session recursive test
      selftests/bpf: Add uprobe session verifier test for return value
      selftests/bpf: Add kprobe session verifier test for return value
      selftests/bpf: Add uprobe session single consumer test
      selftests/bpf: Add uprobe sessions to consumer test

 include/linux/uprobes.h                                            |  25 +++++++--
 include/uapi/linux/bpf.h                                           |   1 +
 kernel/bpf/syscall.c                                               |   9 +++-
 kernel/bpf/verifier.c                                              |  10 ++++
 kernel/events/uprobes.c                                            | 148 +++++++++++++++++++++++++++++++++++++++++------------
 kernel/trace/bpf_trace.c                                           |  66 +++++++++++++++++-------
 kernel/trace/trace_uprobe.c                                        |  12 +++--
 tools/include/uapi/linux/bpf.h                                     |   1 +
 tools/lib/bpf/bpf.c                                                |   1 +
 tools/lib/bpf/libbpf.c                                             |  22 ++++++--
 tools/lib/bpf/libbpf.h                                             |   4 +-
 tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c              |   2 +-
 tools/testing/selftests/bpf/prog_tests/kprobe_multi_test.c         |   2 +
 tools/testing/selftests/bpf/prog_tests/uprobe_multi_test.c         | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 tools/testing/selftests/bpf/progs/kprobe_multi_verifier.c          |  31 ++++++++++++
 tools/testing/selftests/bpf/progs/uprobe_multi_consumers.c         |  16 +++++-
 tools/testing/selftests/bpf/progs/uprobe_multi_session.c           |  71 ++++++++++++++++++++++++++
 tools/testing/selftests/bpf/progs/uprobe_multi_session_cookie.c    |  48 ++++++++++++++++++
 tools/testing/selftests/bpf/progs/uprobe_multi_session_recursive.c |  44 ++++++++++++++++
 tools/testing/selftests/bpf/progs/uprobe_multi_session_single.c    |  44 ++++++++++++++++
 tools/testing/selftests/bpf/progs/uprobe_multi_verifier.c          |  31 ++++++++++++
 21 files changed, 744 insertions(+), 77 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/progs/kprobe_multi_verifier.c
 create mode 100644 tools/testing/selftests/bpf/progs/uprobe_multi_session.c
 create mode 100644 tools/testing/selftests/bpf/progs/uprobe_multi_session_cookie.c
 create mode 100644 tools/testing/selftests/bpf/progs/uprobe_multi_session_recursive.c
 create mode 100644 tools/testing/selftests/bpf/progs/uprobe_multi_session_single.c
 create mode 100644 tools/testing/selftests/bpf/progs/uprobe_multi_verifier.c

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

end of thread, other threads:[~2024-10-02 13:07 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-29 20:57 [PATCHv5 bpf-next 00/13] uprobe, bpf: Add session support Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 01/13] uprobe: Add data pointer to consumer handlers Jiri Olsa
2024-09-30  9:34   ` Oleg Nesterov
2024-09-30 21:35   ` Andrii Nakryiko
2024-09-29 20:57 ` [PATCHv5 bpf-next 02/13] uprobe: Add support for session consumer Jiri Olsa
2024-09-30  9:40   ` Oleg Nesterov
2024-09-30 11:42     ` Jiri Olsa
2024-09-30 21:36   ` Andrii Nakryiko
2024-10-01 13:17     ` Jiri Olsa
2024-10-01 17:09       ` Andrii Nakryiko
2024-09-29 20:57 ` [PATCHv5 bpf-next 03/13] bpf: Add support for uprobe multi session attach Jiri Olsa
2024-09-30 21:36   ` Andrii Nakryiko
2024-10-01 13:17     ` Jiri Olsa
2024-10-01 17:11       ` Andrii Nakryiko
2024-10-02 13:07         ` Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 04/13] bpf: Add support for uprobe multi session context Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 05/13] bpf: Allow return values 0 and 1 for uprobe/kprobe session Jiri Olsa
2024-09-30 21:36   ` Andrii Nakryiko
2024-10-01 13:18     ` Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 06/13] libbpf: Add support for uprobe multi session attach Jiri Olsa
2024-09-30 21:36   ` Andrii Nakryiko
2024-10-01 13:18     ` Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 07/13] selftests/bpf: Add uprobe session test Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 08/13] selftests/bpf: Add uprobe session cookie test Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 09/13] selftests/bpf: Add uprobe session recursive test Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 10/13] selftests/bpf: Add uprobe session verifier test for return value Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 11/13] selftests/bpf: Add kprobe " Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 12/13] selftests/bpf: Add uprobe session single consumer test Jiri Olsa
2024-09-29 20:57 ` [PATCHv5 bpf-next 13/13] selftests/bpf: Add uprobe sessions to " 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).