tracing/filters: Enable filtering the CPU common field by a cpumask
authorValentin Schneider <vschneid@redhat.com>
Fri, 7 Jul 2023 17:21:50 +0000 (18:21 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 22 Aug 2023 09:13:28 +0000 (05:13 -0400)
commit347d24fc8286e766696cfed112d6a353cb62cb68
tree2e7dc11221b3b6ea18fe429e00d6636a63cac32c
parent3cbec9d7b93d33082cfbbf20fab7ccadd29075ef
tracing/filters: Enable filtering the CPU common field by a cpumask

The tracing_cpumask lets us specify which CPUs are traced in a buffer
instance, but doesn't let us do this on a per-event basis (unless one
creates an instance per event).

A previous commit added filtering scalar fields by a user-given cpumask,
make this work with the CPU common field as well.

This enables doing things like

$ trace-cmd record -e 'sched_switch' -f 'CPU & CPUS{12-52}' \
   -e 'sched_wakeup' -f 'target_cpu & CPUS{12-52}'

Link: https://lkml.kernel.org/r/20230707172155.70873-5-vschneid@redhat.com
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Leonardo Bras <leobras@redhat.com>
Cc: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_filter.c