Skip to content

unwind_deferred: Core infrasrtucture for v6.17

Steven Rostedt lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10unwind_user: Add user space unwinding API with frame pointer supportMAINTAINERS arch/Kconfig include/asm-generic/Kbuild +6 more+209 -00 replies
2/10unwind_user/deferred: Add unwind_user_faultable()include/linux/sched.h include/linux/unwind_deferred.h include/linux/unwind_deferred_types.h +3 more+103 -10 replies
3/10unwind_user/deferred: Add unwind cacheinclude/linux/entry-common.h include/linux/unwind_deferred.h include/linux/unwind_deferred_types.h +1 more+40 -80 replies
4/10unwind_user/deferred: Add deferred unwinding interfaceinclude/linux/unwind_deferred.h include/linux/unwind_deferred_types.h kernel/unwind/deferred.c+203 -10 replies
5/10unwind_user/deferred: Make unwind deferral requests NMI-safekernel/unwind/deferred.c+44 -80 replies
6/10unwind deferred: Use bitmask to determine which callbacks to callinclude/linux/unwind_deferred.h include/linux/unwind_deferred_types.h kernel/unwind/deferred.c+92 -230 replies
7/10unwind deferred: Add unwind_completed mask to stop spurious callbacksinclude/linux/unwind_deferred.h include/linux/unwind_deferred_types.h kernel/unwind/deferred.c+19 -50 replies
8/10unwind: Add USED bit to only have one conditional on way back to user spaceinclude/linux/unwind_deferred.h kernel/unwind/deferred.c+13 -100 replies
9/10unwind deferred: Use SRCU unwind_deferred_task_work()kernel/unwind/deferred.c+21 -60 replies
10/10unwind: Finish up unwind when a task exitsinclude/linux/unwind_deferred.h kernel/exit.c kernel/unwind/deferred.c+25 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [for-next][PATCH 00/10] unwind_deferred: Core infrasrtucture for v6.17

This is the core infrastructure for the deferred unwinder that is required for sframes[1]. Several other patch series is based on this work although those patch series are not dependent on each other. In order to simplify the development, having this core series upstream will allow the other series to be worked on in parallel. The other series are:

- The two patches to implement x86:
https://lore.kernel.org/linux-trace-kernel/[email protected]/
https://lore.kernel.org/linux-trace-kernel/[email protected]/

- The s390 work:
https://lore.kernel.org/linux-trace-kernel/[email protected]/

- The perf work:
https://lore.kernel.org/linux-trace-kernel/[email protected]/

- The ftrace work:
https://lore.kernel.org/linux-trace-kernel/[email protected]/

- The sframe work:
https://lore.kernel.org/linux-trace-kernel/[email protected]/

And more is on the way.

The core infrastructure adds the following in kernel APIs:

- int unwind_user_faultable(struct unwind_stacktrace *trace);

Performs a user space stack trace that may fault user pages in.

- int unwind_deferred_init(struct unwind_work *work, unwind_callback_t func);

Allows a tracer to register with the unwind deferred infrastructure.

- int unwind_deferred_request(struct unwind_work *work, u64 *cookie);

Used when a tracer request a deferred trace. Can be called from interrupt or NMI context.

- void unwind_deferred_cancel(struct unwind_work *work);

Called by a tracer to unregister from the deferred unwind infrastructure.

- void unwind_deferred_task_exit(struct task_struct *task);

Called by task exit code to flush any pending unwind requests.

- void unwind_task_init(struct task_struct *task);

Called by do_fork() to initialize the task struct for the deferred unwinder.

- void unwind_task_free(struct task_struct *task);

Called by do_exit() to free up any resources used by the deferred unwinder.

None of the above is actually compiled unless an architecture enables it, which none currently do.

[1] https://sourceware.org/binutils/wiki/sframe

git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
unwind/for-next

Head SHA1: 2879dee3655de961e4c0d715c36b9c550dd7c2de

Josh Poimboeuf (3):
unwind_user: Add user space unwinding API with frame pointer support unwind_user/deferred: Add unwind cache unwind_user/deferred: Add deferred unwinding interface

Steven Rostedt (7):
unwind_user/deferred: Add unwind_user_faultable() unwind_user/deferred: Make unwind deferral requests NMI-safe unwind deferred: Use bitmask to determine which callbacks to call unwind deferred: Add unwind_completed mask to stop spurious callbacks
unwind: Add USED bit to only have one conditional on way back to user space unwind deferred: Use SRCU unwind_deferred_task_work()
unwind: Finish up unwind when a task exits

----

 MAINTAINERS                           |   8 +
 arch/Kconfig                          |   7 +
 include/asm-generic/Kbuild            |   1 +
 include/asm-generic/unwind_user.h     |   5 +
 include/linux/entry-common.h          |   2 +
 include/linux/sched.h                 |   5 +
 include/linux/unwind_deferred.h       |  81 ++++++++
 include/linux/unwind_deferred_types.h |  39 ++++
 include/linux/unwind_user.h           |  14 ++
 include/linux/unwind_user_types.h     |  44 +++++
 kernel/Makefile                       |   1 +
 kernel/exit.c                         |   2 +
 kernel/fork.c                         |   4 +
 kernel/unwind/Makefile                |   1 +
 kernel/unwind/deferred.c              | 362 ++++++++++++++++++++++++++++++++++
 kernel/unwind/user.c                  | 128 ++++++++++++
 16 files changed, 704 insertions(+)
 create mode 100644 include/asm-generic/unwind_user.h
 create mode 100644 include/linux/unwind_deferred.h
 create mode 100644 include/linux/unwind_deferred_types.h
 create mode 100644 include/linux/unwind_user.h
 create mode 100644 include/linux/unwind_user_types.h
 create mode 100644 kernel/unwind/Makefile
 create mode 100644 kernel/unwind/deferred.c
 create mode 100644 kernel/unwind/user.c