On Fri, 14 Nov 2025 08:53:32 -0500
Steven Rostedt <[email protected]> wrote:

> --- a/include/linux/unwind_deferred_types.h
> +++ b/include/linux/unwind_deferred_types.h
> @@ -2,10 +2,14 @@
>  #ifndef _LINUX_UNWIND_USER_DEFERRED_TYPES_H
>  #define _LINUX_UNWIND_USER_DEFERRED_TYPES_H
>  
> +/* Make the cache fit in a 4K page */
> +#define UNWIND_MAX_ENTRIES                                   \
> +     ((SZ_4K - offset_of(struct unwind_cache, entries)) / sizeof(long))
> +
>  struct unwind_cache {
>       unsigned long           unwind_completed;
>       unsigned int            nr_entries;
> -     unsigned long           entries[];
> +     unsigned long           entries[UNWIND_MAX_ENTRIES];
>  };
>  

Nope, this fails with:

/work/git/test-linux.git/include/linux/stddef.h:16:33: error: invalid use of 
undefined type ‘struct unwind_cache’
   16 | #define offsetof(TYPE, MEMBER)  __builtin_offsetof(TYPE, MEMBER)
      |                                 ^~~~~~~~~~~~~~~~~~
/work/git/test-linux.git/include/linux/unwind_deferred_types.h:9:19: note: in 
expansion of macro ‘offsetof’
    9 |         ((SZ_4K - offsetof(struct unwind_cache, entries)) / 
sizeof(long))
      |                   ^~~~~~~~
/work/git/test-linux.git/include/linux/unwind_deferred_types.h:14:41: note: in 
expansion of macro ‘UNWIND_MAX_ENTRIES’
   14 |         unsigned long           entries[UNWIND_MAX_ENTRIES];
      |                                         ^~~~~~~~~~~~~~~~~~

-- Steve

Reply via email to