kernel-hacking-2024-linux-s.../kernel/trace
Steven Rostedt (Red Hat) e57cbaf0eb tracing: Do not have 'comm' filter override event 'comm' field
Commit 9f61668073 "tracing: Allow triggers to filter for CPU ids and
process names" added a 'comm' filter that will filter events based on the
current tasks struct 'comm'. But this now hides the ability to filter events
that have a 'comm' field too. For example, sched_migrate_task trace event.
That has a 'comm' field of the task to be migrated.

 echo 'comm == "bash"' > events/sched_migrate_task/filter

will now filter all sched_migrate_task events for tasks named "bash" that
migrates other tasks (in interrupt context), instead of seeing when "bash"
itself gets migrated.

This fix requires a couple of changes.

1) Change the look up order for filter predicates to look at the events
   fields before looking at the generic filters.

2) Instead of basing the filter function off of the "comm" name, have the
   generic "comm" filter have its own filter_type (FILTER_COMM). Test
   against the type instead of the name to assign the filter function.

3) Add a new "COMM" filter that works just like "comm" but will filter based
   on the current task, even if the trace event contains a "comm" field.

Do the same for "cpu" field, adding a FILTER_CPU and a filter "CPU".

Cc: stable@vger.kernel.org # v4.3+
Fixes: 9f61668073 "tracing: Allow triggers to filter for CPU ids and process names"
Reported-by: Matt Fleming <matt@codeblueprint.co.uk>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2016-03-04 09:57:10 -05:00
..
blktrace.c convert a bunch of open-coded instances of memdup_user_nul() 2016-01-04 10:26:58 -05:00
bpf_trace.c perf/bpf: Convert perf_event_array to use struct file 2016-01-29 08:35:25 +01:00
ftrace.c ftrace: Fix the race between ftrace and insmod 2016-01-07 15:56:21 -05:00
Kconfig Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2015-11-10 18:11:41 -08:00
Makefile
power-traces.c
ring_buffer.c ring-buffer: Process commits whenever moving to a new page. 2015-11-25 15:24:05 -05:00
ring_buffer_benchmark.c ring_buffer: Remove unneeded smp_wmb() before wakeup of reader benchmark 2015-11-03 16:19:02 -05:00
rpm-traces.c
trace.c tracing: Fix stacktrace skip depth in trace_buffer_unlock_commit_regs() 2016-01-14 09:28:19 -05:00
trace.h tracing: Fix comment to use tracing_on over tracing_enable 2015-12-23 14:27:25 -05:00
trace_benchmark.c tracing: Only benchmark the time tracepoints take if tracing is on 2015-11-02 13:34:58 -05:00
trace_benchmark.h
trace_branch.c
trace_clock.c
trace_entries.h
trace_event_perf.c Not much new with tracing for this release. Mostly just clean ups and 2016-01-12 20:04:15 -08:00
trace_events.c tracing: Do not have 'comm' filter override event 'comm' field 2016-03-04 09:57:10 -05:00
trace_events_filter.c tracing: Do not have 'comm' filter override event 'comm' field 2016-03-04 09:57:10 -05:00
trace_events_filter_test.h
trace_events_trigger.c Not much new with tracing for this release. Mostly just clean ups and 2016-01-12 20:04:15 -08:00
trace_export.c tracing: ftrace_event_is_function() can return boolean 2015-11-02 14:28:05 -05:00
trace_functions.c
trace_functions_graph.c tracing: Remove unused ftrace_cpu_disabled per cpu variable 2015-11-07 13:25:14 -05:00
trace_irqsoff.c tracing: report_latency() in trace_irqsoff.c can return boolean 2015-11-02 14:20:19 -05:00
trace_kdb.c
trace_kprobe.c
trace_mmiotrace.c
trace_nop.c
trace_output.c
trace_output.h
trace_printk.c tracing: Fix setting of start_index in find_next() 2016-01-04 15:22:47 -05:00
trace_probe.c
trace_probe.h
trace_sched_switch.c
trace_sched_wakeup.c Most of the changes are clean ups and small fixes. Some of them have 2015-11-06 13:30:20 -08:00
trace_selftest.c
trace_selftest_dynamic.c
trace_seq.c
trace_stack.c tracing, kasan: Silence Kasan warning in check_stack of stack_tracer 2016-02-19 12:36:44 -05:00
trace_stat.c
trace_stat.h
trace_syscalls.c
trace_uprobe.c