Re: [PATCH bpf-next] bpf: extend BTF_ID_LIST_GLOBAL with parameter for number of IDs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Nov 10, 2021 at 9:47 AM Song Liu <songliubraving@xxxxxx> wrote:
>
> -#ifdef CONFIG_DEBUG_INFO_BTF
> -BTF_ID_LIST_GLOBAL(btf_sock_ids)
> +BTF_ID_LIST_GLOBAL(btf_sock_ids, MAX_BTF_SOCK_TYPE)
>  #define BTF_SOCK_TYPE(name, type) BTF_ID(struct, type)
>  BTF_SOCK_TYPE_xxx
>  #undef BTF_SOCK_TYPE
> -#else
> -u32 btf_sock_ids[MAX_BTF_SOCK_TYPE];
> -#endif

If we're trying to future proof it I think it would be better
to combine it with MAX_BTF_SOCK_TYPE and BTF_SOCK_TYPE_xxx macro.
(or have another macro that is tracing specific).
That will help avoid cryptic btf_task_struct_ids[0|1|2]
references in the code.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux