On Tue, Mar 8, 2022 at 11:08 PM Yonghong Song <yhs@xxxxxx> wrote: > > > > On 3/7/22 5:44 PM, Andrii Nakryiko wrote: > > On Fri, Mar 4, 2022 at 11:17 AM Hao Luo <haoluo@xxxxxxxxxx> wrote: > >> [...] > >> > >> diff --git a/include/linux/compiler_types.h b/include/linux/compiler_types.h > >> index 3f31ff400432..223abf43679a 100644 > >> --- a/include/linux/compiler_types.h > >> +++ b/include/linux/compiler_types.h > >> @@ -38,7 +38,12 @@ static inline void __chk_io_ptr(const volatile void __iomem *ptr) { } > >> # define __user > >> # endif > >> # define __iomem > >> -# define __percpu > >> +# if defined(CONFIG_DEBUG_INFO_BTF) && defined(CONFIG_PAHOLE_HAS_BTF_TAG) && \ > >> + __has_attribute(btf_type_tag) > >> +# define __percpu __attribute__((btf_type_tag("percpu"))) > > > > > > Maybe let's add > > > > #if defined(CONFIG_DEBUG_INFO_BTF) && > > defined(CONFIG_PAHOLE_HAS_BTF_TAG) && __has_attribute(btf_type_tag) > > #define BTF_TYPE_TAG(value) __attribute__((btf_type_tag(#value))) > > #else > > #define BTF_TYPE_TAG(value) /* nothing */ > > #endif > > > > and use BTF_TYPE_TAG() macro unconditionally everywhere? > > Agree that the above suggestion is a good idea, esp. we may > convert others, e.g., __rcu, with btf_type_tag in the future, > and a common checking will simplify things a lot. > > Hao, could you send a followup patch with Andrii's suggestion? > No problem. Will send the patch this afternoon.