tracing/filters: Optimise CPU vs cpumask filtering when the user mask is a single CPU
authorValentin Schneider <vschneid@redhat.com>
Fri, 7 Jul 2023 17:21:53 +0000 (18:21 +0100)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Tue, 22 Aug 2023 09:13:29 +0000 (05:13 -0400)
commit1cffbe6c62f10e200813ef19caea49bbde71d474
tree52f8650c64fa52df3f3ceb738a2651435b331382
parentca77dd8ce4658d1006d747dd1995ebb9375199c8
tracing/filters: Optimise CPU vs cpumask filtering when the user mask is a single CPU

Steven noted that when the user-provided cpumask contains a single CPU,
then the filtering function can use a scalar as input instead of a
full-fledged cpumask.

In this case we can directly re-use filter_pred_cpu(), we just need to
transform '&' into '==' before executing it.

Link: https://lkml.kernel.org/r/20230707172155.70873-8-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>
Suggested-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Valentin Schneider <vschneid@redhat.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/trace_events_filter.c