On Sun, Dec 19, 2021 at 07:49:22AM IST, Alexei Starovoitov wrote: > On Fri, Dec 17, 2021 at 07:20:25AM +0530, Kumar Kartikeya Dwivedi wrote: > > +static bool is_kfunc_arg_mem_size(const struct btf *btf, > > + const struct btf_param *arg, > > + const struct bpf_reg_state *reg) > > +{ > > + const struct btf_type *t; > > + const char *param_name; > > + > > + t = btf_type_skip_modifiers(btf, arg->type, NULL); > > + if (!btf_type_is_scalar(t) || reg->type != SCALAR_VALUE) > > + return false; > > + > > + /* In the future, this can be ported to use BTF tagging */ > > + param_name = btf_name_by_offset(btf, arg->name_off); > > + if (strncmp(param_name, "len__", sizeof("len__") - 1)) > > + return false; > > I like the feature and approach, but have a suggestion: > The "__sz" suffix would be shorter and more readable. > wdyt? Sounds good, I'll change this in v5. -- Kartikeya