Commit 576bc0b7 authored by Steven Rostedt (Google)'s avatar Steven Rostedt (Google) Committed by Matthias Männich
Browse files

UPSTREAM: tracing: Add __cpumask to denote a trace event field that is a cpumask_t

The trace events have a __bitmask field that can be used for anything
that requires bitmasks. Although currently it is only used for CPU
masks, it could be used in the future for any type of bitmasks.

There is some user space tooling that wants to know if a field is a CPU
mask and not just some random unsigned long bitmask. Introduce
"__cpumask()" helper functions that work the same as the current
__bitmask() helpers but displays in the format file:

  field:__data_loc cpumask_t *[] mask;    offset:36;      size:4; signed:0;

Instead of:

  field:__data_loc unsigned long[] mask;  offset:32;      size:4; signed:0;

The main difference is the type. Instead of "unsigned long" it is
"cpumask_t *". Note, this type field needs to be a real type in the
__dynamic_array() logic that both __cpumask and__bitmask use, but the
comparison field requires it to be a scalar type whereas cpumask_t is a
structure (non-scalar). But everything works when making it a pointer.

Valentin added changes to remove the need of passing in "nr_bits" and the
__cpumask will always use nr_cpumask_bits as its size.

Link: https://lkml.kernel.org/r/20221014080456.1d32b989@rorschach.local.home



Bug: 326196720
Requested-by: default avatarValentin Schneider <vschneid@redhat.com>
Reviewed-by: default avatarValentin Schneider <vschneid@redhat.com>
Signed-off-by: default avatarValentin Schneider <vschneid@redhat.com>
Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
(cherry picked from commit 8230f27b)
Signed-off-by: default avatarQais Yousef <qyousef@google.com>
Change-Id: Ie7023adf2e632016aaab444e92d5e093bab8f5cb
(cherry picked from commit ff42c452b9eb0e708ecd0a8e51c2d067771c3c8c)
Signed-off-by: default avatarQais Yousef <qyousef@google.com>
parent f5bd7460
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment