Linux Trace Kernel
 help / color / mirror / Atom feed
* [v2 PATCH 0/2] tracing: Expose global views of active filters and triggers
@ 2026-01-05 14:29 Aaron Tomlin
  2026-01-05 14:29 ` [v2 PATCH 1/2] tracing: Add show_event_filters to expose active event filters Aaron Tomlin
  2026-01-05 14:29 ` [v2 PATCH 2/2] tracing: Add show_event_triggers to expose active event triggers Aaron Tomlin
  0 siblings, 2 replies; 7+ messages in thread
From: Aaron Tomlin @ 2026-01-05 14:29 UTC (permalink / raw)
  To: rostedt, mhiramat, mark.rutland, mathieu.desnoyers, corbet
  Cc: neelx, sean, linux-kernel, linux-trace-kernel, linux-doc

Hi Steve,

Currently, auditing active Ftrace event filters or triggers requires userspace
to recursively traverse the "events/" directory and read the "filter" or
"trigger" file for every individual event. For monitoring tools, security
auditors, or developers debugging complex tracing setups, this O(n) traversal
is inefficient and cumbersome.

This series introduces two new files at the trace root directory to provide
a consolidated, system-wide view of active event configurations:

    1. show_event_filters: Displays all events with an active filter
    2. show_event_triggers: Displays all events with active triggers

Both files utilise the system:event [tab] config format, allowing for easy
parsing by standard tools (e.g., awk) or custom monitoring agents.

The patches leverage the existing trace_event_file iterators to ensure atomic
and efficient traversal of the event list. Scope-based RCU protection
(guard(rcu)) is used for filter string access, whilst the existing event_mutex
protection within the iterator ensures safe traversal of the event trigger
lists. For triggers, we utilise the internal cmd_ops->print() callbacks to 
guarantee that the consolidated output remains consistent with the legacy
per-event interface.


Changes since v1 [1]:
 - Clarified that all events with filters are listed, regardless of
   enablement state (Steven Rostedt)
 - Optimise filter display logic by utilising the guard(rcu) macro for cleaner 
   scope-based RCU protection and early return (Steven Rostedt)
 - Add show_event_triggers to expose event triggers alongside filters
   (Steven Rostedt)

[1]: https://lore.kernel.org/lkml/20260101233414.2476973-1-atomlin@atomlin.com/

Aaron Tomlin (2):
  tracing: Add show_event_filters to expose active event filters
  tracing: Add show_event_triggers to expose active event triggers

 Documentation/trace/ftrace.rst |  16 +++++
 kernel/trace/trace_events.c    | 122 +++++++++++++++++++++++++++++++++
 2 files changed, 138 insertions(+)

-- 
2.51.0


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

end of thread, other threads:[~2026-01-07  1:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-05 14:29 [v2 PATCH 0/2] tracing: Expose global views of active filters and triggers Aaron Tomlin
2026-01-05 14:29 ` [v2 PATCH 1/2] tracing: Add show_event_filters to expose active event filters Aaron Tomlin
2026-01-05 14:29 ` [v2 PATCH 2/2] tracing: Add show_event_triggers to expose active event triggers Aaron Tomlin
2026-01-06  6:10   ` Randy Dunlap
2026-01-06 15:17     ` Steven Rostedt
2026-01-06 16:08       ` Randy Dunlap
2026-01-07  1:15         ` Aaron Tomlin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox