mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-19 17:11:03 +00:00
8230f27b1c
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 Requested-by: Valentin Schneider <vschneid@redhat.com> Reviewed-by: Valentin Schneider <vschneid@redhat.com> Signed-off-by: Valentin Schneider <vschneid@redhat.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
63 lines
1.6 KiB
C
63 lines
1.6 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
/* Stage 2 definitions for creating trace events */
|
|
|
|
#undef TRACE_DEFINE_ENUM
|
|
#define TRACE_DEFINE_ENUM(a)
|
|
|
|
#undef TRACE_DEFINE_SIZEOF
|
|
#define TRACE_DEFINE_SIZEOF(a)
|
|
|
|
#undef __field
|
|
#define __field(type, item)
|
|
|
|
#undef __field_ext
|
|
#define __field_ext(type, item, filter_type)
|
|
|
|
#undef __field_struct
|
|
#define __field_struct(type, item)
|
|
|
|
#undef __field_struct_ext
|
|
#define __field_struct_ext(type, item, filter_type)
|
|
|
|
#undef __array
|
|
#define __array(type, item, len)
|
|
|
|
#undef __dynamic_array
|
|
#define __dynamic_array(type, item, len) u32 item;
|
|
|
|
#undef __string
|
|
#define __string(item, src) __dynamic_array(char, item, -1)
|
|
|
|
#undef __string_len
|
|
#define __string_len(item, src, len) __dynamic_array(char, item, -1)
|
|
|
|
#undef __vstring
|
|
#define __vstring(item, fmt, ap) __dynamic_array(char, item, -1)
|
|
|
|
#undef __bitmask
|
|
#define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
|
|
|
|
#undef __cpumask
|
|
#define __cpumask(item) __dynamic_array(unsigned long, item, -1)
|
|
|
|
#undef __sockaddr
|
|
#define __sockaddr(field, len) __dynamic_array(u8, field, len)
|
|
|
|
#undef __rel_dynamic_array
|
|
#define __rel_dynamic_array(type, item, len) u32 item;
|
|
|
|
#undef __rel_string
|
|
#define __rel_string(item, src) __rel_dynamic_array(char, item, -1)
|
|
|
|
#undef __rel_string_len
|
|
#define __rel_string_len(item, src, len) __rel_dynamic_array(char, item, -1)
|
|
|
|
#undef __rel_bitmask
|
|
#define __rel_bitmask(item, nr_bits) __rel_dynamic_array(unsigned long, item, -1)
|
|
|
|
#undef __rel_cpumask
|
|
#define __rel_cpumask(item) __rel_dynamic_array(unsigned long, item, -1)
|
|
|
|
#undef __rel_sockaddr
|
|
#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)
|