tracing: Deferred unwinding of user space stack traces
Get series with b4
b4 am [email protected]Versions newest first
- v6 Latest6 patches 56 repliesIn review
Patches in v6 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | tracing: Do not bother getting user space stacktraces for kernel threadskernel/ | +4 | 0 replies | |
| 2/6 | tracing: Rename __dynamic_array() to __dynamic_field() for ftrace eventskernel/ kernel/ kernel/ | +13 | 0 replies | |
| 3/6 | tracing: Implement deferred user space stacktracingkernel/ kernel/ kernel/ +2 more | +227 | 0 replies | |
| 4/6 | tracing: Have deferred user space stacktrace show file offsetskernel/ | +19 | 0 replies | |
| 5/6 | tracing: Show inode and device major:minor in deferred user space stacktracekernel/ kernel/ kernel/ | +58 | 56 replies | |
| 6/6 | tracing: Add an event to map the inodes to their file nameskernel/ kernel/ kernel/ +2 more | +212 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v6 yet.
Cover letter [PATCH v6 0/6] tracing: Deferred unwinding of user space stack traces
This is the tracefs (ftrace) implementation of the deferred stack tracing.
This creates two new events that get set for every trace event when the new "userstacktrace_delay" option is enabled. The first event happens at the time of the request (after a trace event) that saves the cookie that represents the current user space stack trace (it stays the same while the task is in the kernel, as the user space stack doesn't change during this time). The second event is where the user space stacktrace is recorded along with the cookie.
Since the callback is called in faultable context, it uses this opportunity to look at the addresses in the stacktrace and convert them to where they would be in the executable file (if found). It also records the inode and device major/minor numbers into the trace, so that post processing can find the exact location where the stacks are.
To simplify the finding of the files, a new "inode_cache" event is created that gets triggered whenever a new inode/device is added to a new rhashtable. It will then look up the path that represents that inode/device via the vma descriptor. To keep the recording down to a minimum, this event is only triggered when a new inode/device is added to the rhashtable. The rhashtable is reset when certain changes occur in the tracefs system so that new readers of this event can get the latest changes.
Changes since v5: https://lore.kernel.org/linux-trace-kernel/[email protected]/
- Removed unwind infrastructure patches as they have already been merged.
- Also add check for PF_USER_WORKER to test for kernel thread
- Have the userstacktrace_delay option not depend on the userstacktrace option.
- Do not expose the userstacktrace_delay option if it's not supported.
- Set inode to -1L if vma is not found for that address to let user space know that, and differentiate from a vdso section.
- Added "inode_cache" to dsiplay inode/device paths when added to a stack trace
Steven Rostedt (6):
tracing: Do not bother getting user space stacktraces for kernel threads
tracing: Rename __dynamic_array() to __dynamic_field() for ftrace events
tracing: Implement deferred user space stacktracing
tracing: Have deferred user space stacktrace show file offsets
tracing: Show inode and device major:minor in deferred user space stacktrace
tracing: Add an event to map the inodes to their file names
----
kernel/trace/Makefile | 3 + kernel/trace/inode_cache.c | 144 ++++++++++++++++++++++++++++++++++++++ kernel/trace/trace.c | 146 ++++++++++++++++++++++++++++++++++++++- kernel/trace/trace.h | 32 ++++++++- kernel/trace/trace_entries.h | 38 ++++++++-- kernel/trace/trace_export.c | 25 ++++++- kernel/trace/trace_inode_cache.h | 42 +++++++++++ kernel/trace/trace_output.c | 99 ++++++++++++++++++++++++++ 8 files changed, 520 insertions(+), 9 deletions(-) create mode 100644 kernel/trace/inode_cache.c create mode 100644 kernel/trace/trace_inode_cache.h