Re: [PATCH bpf-next 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-16 Thread Yonghong Song
On 10/15/18 3:36 PM, Daniel Borkmann wrote: > On 10/12/2018 08:54 PM, Yonghong Song wrote: > [...] >> +static bool btf_name_valid_identifier(const struct btf *btf, u32 offset) >> +{ >> +/* offset must be valid */ >> +const char *src = &btf->strings[offset]; >> + >> +if (!isalpha(*src)

Re: [PATCH bpf-next 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-16 Thread Yonghong Song
On 10/15/18 3:30 PM, Daniel Borkmann wrote: > On 10/12/2018 08:54 PM, Yonghong Song wrote: >> This patch adds BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO >> support to the type section. BTF_KIND_FUNC_PROTO is used >> to specify the type of a function pointer. With this, >> BTF has a complete set of C t

Re: [PATCH bpf-next 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-15 Thread Daniel Borkmann
On 10/12/2018 08:54 PM, Yonghong Song wrote: [...] > +static bool btf_name_valid_identifier(const struct btf *btf, u32 offset) > +{ > + /* offset must be valid */ > + const char *src = &btf->strings[offset]; > + > + if (!isalpha(*src) && *src != '_') > + return false; > + >

Re: [PATCH bpf-next 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-15 Thread Daniel Borkmann
On 10/12/2018 08:54 PM, Yonghong Song wrote: > This patch adds BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO > support to the type section. BTF_KIND_FUNC_PROTO is used > to specify the type of a function pointer. With this, > BTF has a complete set of C types (except float). > > BTF_KIND_FUNC is used to s

[PATCH bpf-next 02/13] bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO

2018-10-12 Thread Yonghong Song
This patch adds BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO support to the type section. BTF_KIND_FUNC_PROTO is used to specify the type of a function pointer. With this, BTF has a complete set of C types (except float). BTF_KIND_FUNC is used to specify the signature of a defined subprogram. BTF_KIND_FU