Skip to content

Commit fab89a0

Browse files
committed
tracing: Remove pointer (asterisk) and brackets from cpumask_t field
To differentiate between long arrays and cpumasks, the __cpumask() field was created. Part of the TRACE_EVENT() macros test if the type is signed or not by using the is_signed_type() macro. The __cpumask() field used the __dynamic_array() helper but because cpumask_t is a structure, it could not be used in the is_signed_type() macro as that would fail to build, so instead it passed in the pointer to cpumask_t. Unfortunately, that creates in the format file: field:__data_loc cpumask_t *[] mask; offset:36; size:4; signed:0; Which looks like an array of pointers to cpumask_t and not a cpumask_t type, which is misleading to user space parsers. Douglas Raillard pointed out that the "[]" are also misleading, as cpumask_t is not an array. Since cpumask() hasn't been created yet, and the parsers currently fail on it (but will still produce the raw output), make it be: field:__data_loc cpumask_t mask; offset:36; size:4; signed:0; Which is the correct type of the field. Then the parsers can be updated to handle this. Link: https://lore.kernel.org/lkml/[email protected]/ Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Valentin Schneider <[email protected]> Cc: Andrew Morton <[email protected]> Fixes: 8230f27 ("tracing: Add __cpumask to denote a trace event field that is a cpumask_t") Reported-by: Douglas Raillard <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent a785736 commit fab89a0

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

include/trace/stages/stage4_event_fields.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@
4747
#define __bitmask(item, nr_bits) __dynamic_array(unsigned long, item, -1)
4848

4949
#undef __cpumask
50-
#define __cpumask(item) __dynamic_array(cpumask_t *, item, -1)
50+
#define __cpumask(item) { \
51+
.type = "__data_loc cpumask_t", .name = #item, \
52+
.size = 4, .align = 4, \
53+
.is_signed = 0, .filter_type = FILTER_OTHER },
5154

5255
#undef __sockaddr
5356
#define __sockaddr(field, len) __dynamic_array(u8, field, len)
@@ -68,7 +71,10 @@
6871
#define __rel_bitmask(item, nr_bits) __rel_dynamic_array(unsigned long, item, -1)
6972

7073
#undef __rel_cpumask
71-
#define __rel_cpumask(item) __rel_dynamic_array(cpumask_t *, item, -1)
74+
#define __rel_cpumask(item) { \
75+
.type = "__rel_loc cpumask_t", .name = #item, \
76+
.size = 4, .align = 4, \
77+
.is_signed = 0, .filter_type = FILTER_OTHER },
7278

7379
#undef __rel_sockaddr
7480
#define __rel_sockaddr(field, len) __rel_dynamic_array(u8, field, len)

0 commit comments

Comments
 (0)