|
2 | 2 |
|
3 | 3 | /* Stage 4 definitions for creating trace events */
|
4 | 4 |
|
| 5 | +#define ALIGN_STRUCTFIELD(type) ((int)(offsetof(struct {char a; type b;}, b))) |
| 6 | + |
5 | 7 | #undef __field_ext
|
6 | 8 | #define __field_ext(_type, _item, _filter_type) { \
|
7 | 9 | .type = #_type, .name = #_item, \
|
8 |
| - .size = sizeof(_type), .align = __alignof__(_type), \ |
| 10 | + .size = sizeof(_type), .align = ALIGN_STRUCTFIELD(_type), \ |
9 | 11 | .is_signed = is_signed_type(_type), .filter_type = _filter_type },
|
10 | 12 |
|
11 | 13 | #undef __field_struct_ext
|
12 | 14 | #define __field_struct_ext(_type, _item, _filter_type) { \
|
13 | 15 | .type = #_type, .name = #_item, \
|
14 |
| - .size = sizeof(_type), .align = __alignof__(_type), \ |
| 16 | + .size = sizeof(_type), .align = ALIGN_STRUCTFIELD(_type), \ |
15 | 17 | 0, .filter_type = _filter_type },
|
16 | 18 |
|
17 | 19 | #undef __field
|
|
23 | 25 | #undef __array
|
24 | 26 | #define __array(_type, _item, _len) { \
|
25 | 27 | .type = #_type"["__stringify(_len)"]", .name = #_item, \
|
26 |
| - .size = sizeof(_type[_len]), .align = __alignof__(_type), \ |
| 28 | + .size = sizeof(_type[_len]), .align = ALIGN_STRUCTFIELD(_type), \ |
27 | 29 | .is_signed = is_signed_type(_type), .filter_type = FILTER_OTHER },
|
28 | 30 |
|
29 | 31 | #undef __dynamic_array
|
|
0 commit comments