On Tue, 3 Feb 2026 18:04:21 +0800 (CST)
"jempty.liang" [off-list ref] wrote:
quoted
#include "trace_output.h"
+/* The alignment of a type when in a structure */
+#define ALIGN_STRUCTFIELD(type) ((int)(__alignof__(struct {type b;})))
+
/* Stub function for events with triggers */
static int ftrace_event_register(struct trace_event_call *call,
enum trace_reg type, void *data)@@ -88,7 +91,7 @@ static void __always_unused ____ftrace_check_##name(void) \
#undef __field_ext
#define __field_ext(_type, _item, _filter_type) { \
.type = #_type, .name = #_item, \
- .size = sizeof(_type), .align = __alignof__(_type), \
+ .size = sizeof(_type), .align = ALIGN_STRUCTFIELD(_type), \
is_signed_type(_type), .filter_type = _filter_type },
On the 32-bit ARM platform, when _type is unsigned long long, the resulting align value is 8 instead of the expected 4.
quoted
Are you saying this still doesn't work?
That would be an issue because then it would have the same bugs with
generic trace events which uses the same solution.
-- Steve