Skip to content

Commit 256cfdd

Browse files
committed
tracing: Do not count ftrace events in top level enable output
The file /sys/kernel/tracing/events/enable is used to enable all events by echoing in "1", or disabling all events when echoing in "0". To know if all events are enabled, disabled, or some are enabled but not all of them, cating the file should show either "1" (all enabled), "0" (all disabled), or "X" (some enabled but not all of them). This works the same as the "enable" files in the individule system directories (like tracing/events/sched/enable). But when all events are enabled, the top level "enable" file shows "X". The reason is that its checking the "ftrace" events, which are special events that only exist for their format files. These include the format for the function tracer events, that are enabled when the function tracer is enabled, but not by the "enable" file. The check includes these events, which will always be disabled, and even though all true events are enabled, the top level "enable" file will show "X" instead of "1". To fix this, have the check test the event's flags to see if it has the "IGNORE_ENABLE" flag set, and if so, not test it. Cc: stable@vger.kernel.org Fixes: 553552c ("tracing: Combine event filter_active and enable into single flags field") Reported-by: "Yordan Karadzhov (VMware)" <y.karadz@gmail.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent c8b186a commit 256cfdd

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

kernel/trace/trace_events.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,8 @@ system_enable_read(struct file *filp, char __user *ubuf, size_t cnt,
12121212
mutex_lock(&event_mutex);
12131213
list_for_each_entry(file, &tr->events, list) {
12141214
call = file->event_call;
1215-
if (!trace_event_name(call) || !call->class || !call->class->reg)
1215+
if ((call->flags & TRACE_EVENT_FL_IGNORE_ENABLE) ||
1216+
!trace_event_name(call) || !call->class || !call->class->reg)
12161217
continue;
12171218

12181219
if (system && strcmp(call->class->system, system->name) != 0)

0 commit comments

Comments
 (0)