[GIT PULL] tracing: Updates for 6.1

From: Steven Rostedt
Date: Thu Oct 06 2022 - 11:40:36 EST


Note the first two major changes. This is the first pull request from the
new location at:


Masami Hiramatsu will also be co-maintainer and may be sending pull
requests to you in the future. We will start breaking this up in topic
branches, and this will likely be the last time a single pull request for
tracing/ftrace/kprobes will be done from this tree.

Tracing updates for 6.1:

Major changes:

- Changed location of tracing repo from personal git repo to:

- Added Masami Hiramatsu as co-maintainer

- Updated MAINTAINERS file to separate out FTRACE as it is
more than just TRACING.

Minor changes:

- Added Mark Rutland as FTRACE reviewer

- Updated user_events to make it on its way to remove the BROKEN tag.
The changes should now be acceptable but will run it through
a cycle and hopefully we can remove the BROKEN tag next release.

- Added filtering to eprobes

- Added a delta time to the benchmark trace event

- Have the histogram and filter callbacks called via a switch
statement instead of indirect functions. This speeds it up to
avoid retpolines.

- Add a way to wake up ring buffer waiters waiting for the
ring buffer to fill up to its watermark.

- New ioctl() on the trace_pipe_raw file to wake up ring buffer

- Wake up waiters when the ring buffer is disabled.
A reader may block when the ring buffer is disabled,
but if it was blocked when the ring buffer is disabled
it should then wake up.


- Allow splice to read partially read ring buffer pages
Fixes splice never moving forward.

- Fix inverted compare that made the "shortest" ring buffer
wait queue actually the longest.

- Fix a race in the ring buffer between resetting a page when
a writer goes to another page, and the reader.

- Fix ftrace accounting bug when function hooks are added at
boot up before the weak functions are set to "disabled".

- Fix bug that freed a user allocated snapshot buffer when
enabling a tracer.

- Fix possible recursive locks in osnoise tracer

- Fix recursive locking direct functions

- And other minor clean ups and fixes

Please pull the latest trace-v6.1 tree, which can be found at:


Tag SHA1: 9b396ae1e13db1a6d48855eaee57341ced5db5ff
Head SHA1: 4f881a696484a7d31a4d1b12547615b1a3ee5771

Beau Belgrave (7):
tracing/user_events: Use NULL for strstr checks
tracing/user_events: Use WRITE instead of READ for io vector import
tracing/user_events: Ensure user provided strings are safely formatted
tracing/user_events: Use refcount instead of atomic for ref tracking
tracing/user_events: Use bits vs bytes for enabled status page data
tracing/user_events: Update ABI documentation to align to bits vs bytes
tracing/user_events: Move pages/locks into groups to prepare for namespaces

Chen Zhongjin (2):
x86: kprobes: Remove unused macro stack_addr
tracing: Remove unused variable 'dups'

Colin Ian King (1):
tracing: Fix spelling mistake "preapre" -> "prepare"

Gaosheng Cui (3):
x86/ftrace: Remove unused modifying_ftrace_code declaration
x86/kprobes: Remove unused arch_kprobe_override_function() declaration
ftrace: Remove obsoleted code from ftrace and task_struct

Mark Rutland (1):
MAINTAINERS: add myself as a tracing reviewer

Masami Hiramatsu (Google) (2):
tracing/eprobe: Add eprobe filter support
selftests/ftrace: Add eprobe syntax error testcase

Nico Pache (1):
tracing/osnoise: Fix possible recursive locking in stop_per_cpu_kthreads

Song Liu (1):
ftrace: Fix recursive locking direct_mutex in ftrace_modify_direct_caller

Steven Rostedt (Google) (17):
tracing: Add numeric delta time to the trace event benchmark
tracing/hist: Call hist functions directly via a switch statement
tracing: Move struct filter_pred into trace_events_filter.c
tracing/filter: Call filter predicate functions directly via a switch statement
ring-buffer: Allow splice to read previous partially read pages
ring-buffer: Have the shortest_full queue be the shortest not longest
ring-buffer: Check pending waiters when doing wake ups as well
ring-buffer: Add ring_buffer_wake_waiters()
tracing: Wake up ring buffer waiters on closing of the file
tracing: Add ioctl() to force ring buffer waiters to wake up
tracing: Wake up waiters when tracing is disabled
ring-buffer: Fix race between reset page and reading page
tracing: Add Masami Hiramatsu as co-maintainer
ftrace: Still disable enabled records marked as disabled
tracing: Do not free snapshot if tracer is on cmdline
tracing: Update MAINTAINERS to reflect new tracing git repo
ftrace: Create separate entry in MAINTAINERS for function hooks

Tao Chen (1):
tracing/eprobe: Fix alloc event dir failed when event name no set

Waiman Long (1):
tracing: Disable interrupt or preemption before acquiring arch_spinlock_t

Xiu Jianfeng (1):
rv/monitor: Add __init/__exit annotations to module init/exit funcs

Yipeng Zou (2):
tracing: kprobe: Fix kprobe event gen test module on exit
tracing: kprobe: Make gen test module work in arm and riscv

Zeng Heng (2):
rv/monitors: add 'static' qualifier for local symbols
rv/dot2K: add 'static' qualifier for local variable

Zhen Lei (1):
tracepoint: Optimize the critical region of mutex_lock in tracepoint_module_coming()

Zheng Yejian (1):
ftrace: Properly unset FTRACE_HASH_FL_MOD

Documentation/trace/user_events.rst | 86 +++-
arch/x86/include/asm/ftrace.h | 1 -
arch/x86/include/asm/kprobes.h | 2 -
arch/x86/kernel/kprobes/core.c | 2 -
include/linux/ftrace.h | 41 --
include/linux/ring_buffer.h | 2 +-
include/linux/sched.h | 3 -
include/linux/trace_events.h | 1 +
include/linux/user_events.h | 15 +-
kernel/trace/ftrace.c | 34 +-
kernel/trace/kprobe_event_gen_test.c | 49 +-
kernel/trace/ring_buffer.c | 87 +++-
kernel/trace/rv/monitors/wip/wip.c | 8 +-
kernel/trace/rv/monitors/wwnr/wwnr.c | 8 +-
kernel/trace/trace.c | 78 ++-
kernel/trace/trace.h | 13 -
kernel/trace/trace_benchmark.c | 2 +-
kernel/trace/trace_benchmark.h | 8 +-
kernel/trace/trace_eprobe.c | 107 +++-
kernel/trace/trace_events_filter.c | 239 ++++++---
kernel/trace/trace_events_hist.c | 246 ++++++---
kernel/trace/trace_events_user.c | 568 +++++++++++++++------
kernel/trace/trace_osnoise.c | 3 +-
kernel/trace/trace_probe.h | 3 +-
kernel/trace/tracing_map.c | 5 +-
kernel/tracepoint.c | 14 +-
samples/user_events/example.c | 25 +-
.../test.d/dynevent/eprobes_syntax_errors.tc | 27 +
tools/testing/selftests/user_events/ftrace_test.c | 47 +-
tools/testing/selftests/user_events/perf_test.c | 11 +-
.../dot2/dot2k_templates/main_global.c | 8 +-
.../dot2/dot2k_templates/main_per_cpu.c | 8 +-
.../dot2/dot2k_templates/main_per_task.c | 8 +-
34 files changed, 1299 insertions(+), 486 deletions(-)
create mode 100644 tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc